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); }