I am trying to implement the basic delete action method for a user:
private User_Manager_Interface.Models.ApplicationDbContext userDb = new User_Manager_Interface.Models.ApplicationDbContext();
// POST: /Users/Delete/5
[HttpPost]
public ActionResult Delete(int id, FormCollection collection)
{
try
{
// TODO: Add delete logic here
//.Remove(u => u.id == id);
return RedirectToAction("Index");
}
catch
{
return View();
}
}
I am not entirely sure how to delete a user.
This is what I have tried so far:
userDb.Users.Remove(); But now I don't know how to tell it to delete the user with a certain ID?
How do I do this?