How to edit a user in ASP.NET Identity

前端 未结 2 627
耶瑟儿~
耶瑟儿~ 2020-12-29 17:41

I am new to the ASP.NET Identity framework and I am trying to do some things. What I want to do is to edit the user who has already register and then update the user details

2条回答
  •  清酒与你
    2020-12-29 18:24

    There is a class that comes with asp.net identity called UserManager this class will help with the user information management you can first find a user using either

    • FindByIdAsync
    • FindByEmailAsync
    • FindByUserName

    with the user object, you can then update it with new information for the user profile

    and then use the method UpdateAsync to update the user information in the database.

    when it comes to getting a list of users you can use the IdentityDbContext class to get the list of users from.

提交回复
热议问题