Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Cannot find user #1408


User avatar
0
rishabh7m created

How to find user by email in Web.Api. I have tried this way: var user = await _userManager.FindByEmailAsync(registerModel.Email); It is always giving me null. Note:- Multi tenancy is on.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you are trying to find user of another tenant, you need to switch the target tenant's context like this.

    using(CurrentUnitOfWork.SetTenantId(targetTenantId))
    {
    .....
    }