2023-01-04 17:53:48 +00:00
|
|
|
using DTO;
|
|
|
|
|
|
|
|
public sealed class OrderModel {
|
|
|
|
public long OrderId { get; set; }
|
|
|
|
public string OrderDescription { get; set; }
|
|
|
|
|
|
|
|
public long CustomerId { get; set; }
|
|
|
|
|
|
|
|
public double TotalPrice { get; set; }
|
|
|
|
|
|
|
|
public OrderModel(OrderDto orderDTO) {
|
|
|
|
OrderId = orderDTO.OrderId;
|
2023-01-04 18:47:37 +00:00
|
|
|
OrderDescription = orderDTO.Description.Trim();
|
2023-01-04 17:53:48 +00:00
|
|
|
CustomerId = orderDTO.CustomerId;
|
|
|
|
TotalPrice = orderDTO.Products.Select(product => product.Price).Sum();
|
|
|
|
}
|
|
|
|
}
|