0
I’m new to the Identity, I’m having difficulty implementing the Delete Already Registered Users method. I’ve done Action, I ran View, but I have no knowledge of what methods Identity use to make such operation. I searched on Google, but I must be putting wrong, because I have not found anything so far.
[HttpPost]
public ActionResult Delete(Guid id, IdentityUser user)
{
try
{
_userManager.RemoveFromRoles(id = UserId);
return RedirectToAction("Index");
}
catch
{
return View();
}
}
I’ve only done Action so far:
public ActionResult Delete(Guid ID)
{
return View(UserManager.FindById(ID));
}
[HttpPost]
public ActionResult Delete(Guid id, IdentityUser user)
{
try
{
_userManager.RemoveFromRoles(id = UserId);
return RedirectToAction("Index");
}
catch
{
return View();
}
}
If you can put an excerpt of code, the question got a little fuzzy. Identity is nothing more than the increment of a value, so I don’t know what this influences in deleting value, unless this value is key in another or more tables.
– user59669
Sorry @Rafa_developer, it was a bit vague anyway. I’m using Identity for user authentication, the one that works with Claims , Roles... I’m doing the CRUD to delete the user, but I don’t know what Identity methods to use to do this. I’ve only done one Action so far. I’ll show you right below
– Cesar Alves Pereira
@If you do not add answers, click on the button edit at the bottom left corner when you want to add something new to your question.
– Vinicius