In an MVC5 application, how do you get the values from the AspNetUsers table for the current user?
For example: one of the default files is PhoneNumber. How do you get the phone number of the current registered user?
I am using Identity 2 ...
IdentityUser (, , ApplicationUser ) Entity Framework. , , . , , , User, UserManager<TUser>.FindById() :
IdentityUser
ApplicationUser
User
UserManager<TUser>.FindById()
// UserManager here is an instance of UserManager<ApplicationUser> var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); var number = user.PhoneNumber;
Source: https://habr.com/ru/post/1537662/More articles:PartialTextChanged stops shooting on MvxAutoCompleteTextView after selecting an item - androidClickOnce deployment auto-update does not work - c #Verify successful transaction in sleep mode - javaAuto-complete MVVM and Java Castings without using Java.Lang.Object in ViewModel - c #SQL BETWEEN Conditional value of a statement in reverse order - sqlWhy `.` in PRE 0263 regex? - pythonWhy does transaction.wasCommitted () return false? - javaSVG image as background image in telephone 8 and telephone spread - cordovaWhy can't we have a class labeled [Serializable] and at the same time inheriting from MarshalByRefObject? - c #What happens when an object comes from MarshalByRefObject and is also marked [Serializable]? - c #All Articles