示例#1
0
        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);
        }
示例#2
0
        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
            });
        }
示例#3
0
 public void Create(ProjectsModel projectModel)
 {
     _projectsRepository.Create(projectModel);
 }