Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Getting a Null Result When i try to create user, using the asp.net core default user

$
0
0

So I am using asp.net core user (Authentication and Authorization system). I have seeded my tables newly default tables need for user and roles management have been created but they are all empty.

So I am trying to create a new user.

 var user = new ApplicationUser { Firstname = model.Firstname,Lastname = model.Lastname, UserName = model.Email,  Email = model.Email,  };
                var result = await _userManager.CreateAsync(user, model.Password);

But when I send values to my action method  var result =  ends up been equals to null. This is causing a null pointer exception. What am I doing wrong. I felt user should be created on the spot. Do I need to seed roles. I dont konw what do here.

Thanks alot.

Best Regards.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>