我已使用EntityFramework代码优先模型为MVC应用程序的AspNetUsers表添加了新字段。我可以通过执行以下操作之一来访问我的控制器中的字段:
var currentUser = await HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>().FindByIdAsync(User.Identity.GetUserId());
bool isPrivateModeOn = currentUser.IsPrivateMode;
我实际上如何将值(true / false)设置回数据库中的字段?有人可以帮忙吗?谢谢。