Exemplo n.º 1
0
        public async Task <Issue> CreateAsync(Guid repositoryId, string title, string text = null)
        {
            var issue = new Issue(GuidGenerator.Create(), repositoryId, title, text);

            if (await _issueRepository.AnyAsync(issue => issue.Title == title))
            {
                throw new BusinessException("IssueTracking:IssueWithSameTitleExists");
            }
            return(new Issue(GuidGenerator.Create(), repositoryId, title, text));
        }