Пример #1
0
        public async Task <int> AddProject(Database.Models.Project project)
        {
            if (project.Title == null || project.Description == null)
            {
                throw new Exception("Title or description can not be empty");
            }
            var id = await _projectRepository.AddProjectAsync(project);

            await _projectRepository.AddUserToProjectAsync(CurrentUserService.currentUserId, id);

            await _projectRepository.AddRoleToUserInProject(id, CurrentUserService.currentUserId);

            return(id);
        }