public TenantDto Get(string friendlyName) { this.unitOfWork.BeginTransaction(); friendlyName = friendlyName.ToLower(); TenantDto tenantDto = Mapper.Map <TenantDto>(this.tenantRepo.FindOne(x => x.NameFriendly == friendlyName)); this.unitOfWork.Commit(); return(tenantDto); }
public TenantDto Create(string tenantName, string friendlyName, string timeZoneId, string clientId, Uri authority, string userEmail) { this.unitOfWork.BeginTransaction(); Tenant tenant = Tenant.Create(tenantName, friendlyName, timeZoneId, clientId, authority, userEmail); this.tenantRepo.Add(tenant); TenantDto tenantDto = Mapper.Map <TenantDto>(tenant); this.unitOfWork.Commit(); return(tenantDto); }