public static User IfTenantIsActived(this User user, ITenantRepository tenantRepository) { if (user == null) { return(null); } var tenant = tenantRepository.FindById(new TenantId(user.TenantId)); return(tenant.Active ? user : null); }
public TenantConfiguration Find(Guid id) { using (_currentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! { var tenant = _tenantRepository.FindById(id); if (tenant == null) { return(null); } return(_objectMapper.Map <Tenant, TenantConfiguration>(tenant)); } }