public async Task Create(Project project, string userIdentityLogin) { if (project is null) { throw new ArgumentNullException(nameof(project)); } if (string.IsNullOrEmpty(userIdentityLogin)) { throw new ArgumentException("message", nameof(userIdentityLogin)); } await _projectRepository.Create(project.Adapt <ProjectEntity>(), userIdentityLogin); }
public async Task <Response <ProjectDTO> > Create(Guid userId, Guid teamId, ProjectCreateDTO dto, bool sendInvites = true) { var entity = new ProjectModel { Name = dto.Name, TeamId = teamId, CreatedDate = DateTime.UtcNow, ColorHex = dto.ColorHex, CreatorId = userId }; entity = await _repository.Create(entity); await _projectsUsersRepository.AddProjectUser(entity.Id, userId, MembershipStatus.SuperAdmin); await _membershipService.InviteUsers(entity.Id, InviteEntityType.Project, userId, dto.Emails, sendInvites); var result = _mapper.Map <ProjectModel, ProjectDTO>(entity); return(new Response <ProjectDTO> { Data = result }); }
public void Create(ProjectsModel projectModel) { _projectsRepository.Create(projectModel); }