title: Delete ActionResult .Net Core
body: <p>I get error 'Operator '==' cannot be applied to operands of type 'string' and 'int?' on this line</p>
  
  <pre><code>      .FirstOrDefaultAsync(m =&gt; m.Id == id);
  </code></pre>
  
  <p>I haven't tried anything except this method so far.</p>
  
  <pre><code>  public class EditProfileController : Controller
  {
  
      private readonly ApplicationDbContext db;
      private object _context;
  
      public EditProfileController(ApplicationDbContext Db)
      {
          db = Db;
      }
      public IActionResult Index()
      {
        List&lt;ApplicationUser&gt; listdata = db.Users
          .Select(user =&gt; new ApplicationUser()
          {
              Id =  user.Id,
              UserName = user.UserName,
              NormalizedUserName = user.NormalizedUserName,
                              Email = user.Email
  
  
              // Add the remainder properties
          }).ToList();
      return View(listdata);
      }
      [HttpGet]
      public ActionResult Edit(string id)
      {
          //Get user and return the Edit View
          ApplicationUser user = db.Users.Where(u =&gt; u.Id == id)
        .Select(u =&gt; new ApplicationUser()
        {
            Id = u.Id,
            UserName = u.UserName,
            NormalizedUserName = u.NormalizedUserName,
            Email = u.Email
  
            // Add the remainder properties
        }).FirstOrDefault();
          return View(user);
      }
  
  
      [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Edit(ApplicationUser listdata)
      {
          if (ModelState.IsValid)
          {
              db.Entry(listdata).State = EntityState.Modified;
              db.SaveChanges();
              return RedirectToAction("Index");
          }
          return View(listdata);
      }
  
  
      public async Task&lt;IActionResult&gt; Delete(int? id)
      {
          if (id == null)
          {
              return NotFound();
          }
  
          var user = await db.Users
              .FirstOrDefaultAsync(m =&gt; m.Id == id);
          if (user == null)
          {
              return NotFound();
          }
  
          return View(user);
      }
  
  
      [HttpPost, ActionName("Delete")]
      [ValidateAntiForgeryToken]
      public async Task&lt;IActionResult&gt; DeleteConfirmed(int id)
       {
          var user = await db.Users.FindAsync(id);
          db.Users.Remove(user);
          await db.SaveChangesAsync();
          return RedirectToAction(nameof(Index));
       }
    }
  </code></pre>
  
  <p>My expected results are when i click on the Delete link on the View page that it asks to confirm deletion and then once I click Yes or No it performs the DeleteConfirmed Action. What do I need to fix this error?</p>