0
th3monk3y created
Not sure what I'm missing here, but I can't seem to find the navigation property for the User Email Address for a tenant. Also need to be able to update it. The TenantForEditInput only contains the tenant id.
Thanks
public async Task<TenantForEditDto> GetTenantForEdit(TenantForEditInput input)
{
var tenant = await _tenantManager.GetByIdAsync(input.id);
TenantForEditDto tenantDto = new TenantForEditDto() { Tenant = tenant.MapTo<TenantDto>() };
tenantDto.Tenant.AdminEmailAddress = //?? help
return tenantDto;
}
1 Answer(s)
-
0
Hi,
You can switch to given tenant's context and get the admin user using a repository or usermanager. To do that, you can use something like this.
using (CurrentUnitOfWork.SetTenantId(input.id)) { var adminUser = UserManager.FindByNameAsync(User.AdminUserName); }
A tenant can have more than one user and users of a tenant can be stored in a seperate database from tenant itself. Because of these two reasons there is no navigation property.