Example #1
0
 public static SaleDto FroSale(this SaleDto dto, Sale a)
 {
     dto.Id       = a.Id;
     dto.Book     = a.Book.ToBookDto();
     dto.Customer = a.Customer.ToCustomerDto();
     dto.Date     = a.Date;
     dto.Quantity = a.Quantity;
     dto.Seller   = a.Seller.ToDto();
     return(dto);
 }
Example #2
0
 public static Sale ToSale(this SaleDto dto)
 {
     return(new Sale()
     {
         Id = dto.Id,
         Book = dto.Book.ToBook(),
         Customer = dto.Customer.ToCustomer(),
         Date = dto.Date,
         Quantity = dto.Quantity,
         Seller = dto.Seller.ToSeller()
     });
 }