asp.net - ASP Web Api - How to extend user? -
ASP Web APIs have individual user accounts. It's great! But how do I get to add custom fields to the user? I have followed the steps shown here but I always get an internal server error, which is due to the unit error. It's just fine and works, but I will not make any records in DB if I send a request for it. 'Unused' version works fine, any suggestions?
The source code looks like this - I've added a new category for the user
Public class AppUser: IdentityUser & lt; Br> {Get public string email {get; Set; } & Lt; Br> }
Then replace every IdentytUser with my app user, added the email to the model and db.
And finally a controller revised.
AppUser user = new AppUser & lt; Br> {UserName = model.UserName, & lt; Br> Email = model Email & lt; Br> } IdentityResult result = UserManager.CreateAsync (user, model.Password) awaiting; IHttpActionResult Error Result = GetErrorResult (Results);
It stops working on the last line.
Comments
Post a Comment