Esempio n. 1
0
 public static Report MapHaikuReportingDtoToReport(HaikuReportingDto dto)
 {
     return new Report()
     {
         Reason = dto.Reason,
         DateSent = DateTime.Now
     };
 }
Esempio n. 2
0
 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);
 }