示例#1
0
        public FullEventViewModel MapFull(Event src)
        {
            return(new FullEventViewModel
            {
                Id = src.Id,
                State = src.State.ToString(),
                Created = src.Created,
                LastModified = src.Modified,

                Name = src.Name,
                AllDay = src.AllDay,
                Start = src.Start,
                End = src.End,

                Attendance = src.Attendance.Select(a => AttendanceMapper.Map(a)),
                Reports = src.Reports.Select(r => ReportMapper.Map(r)),
                Images = src.Images.Select(i => ImageMapper.Map(i)),
            });
        }
示例#2
0
 public EventMapper(EventAttendanceMapper attendanceMapper, ReportMapper reportMapper, ImageDescriptionMapper imageMapper)
 {
     AttendanceMapper = attendanceMapper ?? throw new ArgumentNullException(nameof(attendanceMapper));
     ReportMapper     = reportMapper ?? throw new ArgumentNullException(nameof(reportMapper));
     ImageMapper      = imageMapper ?? throw new ArgumentNullException(nameof(imageMapper));
 }