User1389134248 posted
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 exists in DB. But
FindByNameAsync()
function returning null sometimes for the first call.
if I call the 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);
}
Can anyone help me out of this?
Many thanks in advance.
Note: It's not happening every time but happening quite often.