ASP Web API has individual user accounts. It's great! But I don't get how to add custom fields to user. I followed the steps shown here How to extend asp.net web api 2 user? but I always get internal server error, which turned out to be Entity error. It compiles just fine and works, but won't make any records in db if I send requests to it. The 'untouchedd' version works fine, Any suggestions?
The Source code looks like this - I've added a new class for user.
public class AppUser : IdentityUser<br>
{
public string Email { get; set; }<br>
}
Then replaced every IdentytUser with my App user, added Email to model and db.
And finally modified a controller.
AppUser user = new AppUser<br>
{
UserName = model.UserName,<br>
Email = model.Email<br>
}
IdentityResult result = await UserManager.CreateAsync(user, model.Password);
IHttpActionResult errorResult = GetErrorResult(result);
It stops working on the last line.