public static Organization Create(string name, string description, string webSiteUrl, string ownerId, string createdBy) { var entity = new Organization() { Name = name, Description = description, WebSiteUrl = webSiteUrl, OwnerId = ownerId, CreatedBy = createdBy, Status = EntityStatus.Active }; var validationResult = new DataValidatorManager <Organization>().Build().Validate(entity); if (!validationResult.IsValid) { throw new ApplicationException(validationResult.Errors); } entity.GrantUserAccess(createdBy, PipelineRole.OrganizationAdmin); return(entity); }