public void Validate(Tenant tenant) { var existingTenant = TenantHelper.TenantExist(contentService, tenant.TenantUId.ToString()); if (string.IsNullOrEmpty(tenant.SubDomain)) { throw new TenantException(ExceptionCode.SubDomainIsRequired.CodeToString(), ExceptionCode.SubDomainIsRequired, tenant.TenantUId); } if (existingTenant) { throw new TenantException(ExceptionCode.TenantAlreadyExists.CodeToString(), ExceptionCode.TenantAlreadyExists, tenant.TenantUId, tenant.BrandName); } }