Updating user by UserManager.Update() in ASP.NET Identity 2

后端 未结 3 1912
盖世英雄少女心
盖世英雄少女心 2021-02-05 06:25

I use ASP.NET Identity 2 in an MVC 5 project and I want to update Student data by using UserManager.Update() method. However,

3条回答
  •  自闭症患者
    2021-02-05 06:46

    my answer on .netcore 1

    this work for my, I hope can help them

    var user = await _userManager.FindByIdAsync(applicationUser.Id);
                        user.ChargeID = applicationUser.ChargeID;
                        user.CenterID = applicationUser.CenterID;
                        user.Name  = applicationUser.Name;
    var result = await _userManager.UpdateAsync(user);
    

提交回复
热议问题