Ejemplo n.º 1
0
 public static DeliveryDto AsDto(this DeliveryDocument document)
 => new DeliveryDto
 {
     Id            = document.Id,
     OrderId       = document.OrderId,
     Status        = document.Status,
     Registrations = document.Registrations.Select(r => new DeliveryRegistrationDto
     {
         Description = r.Description,
         DateTime    = r.DateTime
     })
 };
Ejemplo n.º 2
0
 public static Delivery AsEntity(this DeliveryDocument document)
 => new Delivery(document.Id, document.OrderId, document.Status,
                 document.Registrations.Select(r => new DeliveryRegistration(r.Description, r.DateTime)));