我已添加到.NET Identity结构中,并尝试更新用户的个人资料。然而,即使数据库显示成功,数据库也不会被更新。任何人都可以看到为什么用户的个人资料不会更新?
通话方式:
Dim _user As ApplicationUser = IdentityHelper.CurrentUser
Dim manager As UserManager = New UserManager()
_user.SelfEvaluationId = Nothing
manager.Update(_user)
ApplicationUser Class:
Public Class UserManager
Inherits UserManager(Of ApplicationUser)
Public Sub New()
MyBase.New(New UserStore(Of ApplicationUser)(New ApplicationDbContext()))
End Sub
End Class
Public Class IdentityHelper
Public Shared ReadOnly Property CurrentUser As ApplicationUser
Get
Dim manager As UserManager = New UserManager()
Return manager.FindById(HttpContext.Current.User.Identity.GetUserId())
End Get
End Property
End Class