public static Report MapHaikuReportingDtoToReport(HaikuReportingDto dto) { return new Report() { Reason = dto.Reason, DateSent = DateTime.Now }; }
public async Task SendReport(int id, HaikuReportingDto dto) { var haiku = await this.unitOfWork.HaikusRepository.GetByIdAsync(id).ConfigureAwait(false); var report = Mapper.MapHaikuReportingDtoToReport(dto); haiku.Reports.Add(report); await this.unitOfWork.CommitAsync().ConfigureAwait(false); }