UserManager value is null for first time to the function FindByNameAsync()

  • Thread starter Thread starter Venky Gopireddy
  • Start date Start date
V

Venky Gopireddy

Guest
var userManager = context.OwinContext.GetUserManager<ApplicationUserManager>();
var user = await userManager.FindByNameAsync(context.UserName);


I have got the value in context.UserName and the same username is existed in DB. But FindByNameAsync() function returning null sometimes for the first call.

if I call same function again it is giving output as expected. when I call it as in the below code.

if(user == null) {

var user = await userManager.FindByNameAsync(context.UserName);

}

Please help me.

Many thanks in advance for the help.

Note : it is not happening every time but happening quite often.

Continue reading...
 
Back
Top