public async Task <BugReport> CreateBugReport(CreateBugReportRequest request) { var baseReport = await CreateBaseReport(request.Subject, request.Content, request.IsPrivate, request.EventDate, ReportCategoryType.Bug); var bugReport = BugReport.Create(baseReport.Id, request.BugType, request.AdditionalInfo); bugReport.SetReport(baseReport); using (var transaction = database.BeginTransaction().Transaction) { if (!await database.ReportRepository.Insert(baseReport, false)) { throw new DatabaseException(); } if (!await database.BugReportRepository.Insert(bugReport, false)) { throw new DatabaseException(); } transaction.Complete(); } await reportImageService.UploadReportImages(httpContextReader.CurrentUserId, baseReport, request.Images); return(bugReport); }