コード例 #1
0
 public static ResourceDto AsDto(this ResourceDocument document)
 => new ResourceDto
 {
     Id           = document.Id,
     Reservations = document.Reservations?.Select(r => new ReservationDto
     {
         DateTime = r.TimeStamp.AsDateTime(),
         Priority = r.Priority
     })
 };
コード例 #2
0
 public static ResourceDto AsDto(this ResourceDocument document)
 => new ResourceDto
 {
     Id           = document.Id,
     Tags         = document.Tags ?? Enumerable.Empty <string>(),
     Reservations = document.Reservations?.Select(r => new ReservationDto
     {
         DateTime = r.TimeStamp.AsDateTime(),
         Priority = r.Priority
     }) ?? Enumerable.Empty <ReservationDto>()
 };
コード例 #3
0
 public static Resource AsEntity(this ResourceDocument document)
 => new Resource(document.Id, document.Tags, document.Reservations
                 .Select(r => new Reservation(r.TimeStamp.AsDateTime(), r.Priority)), document.Version);