17 lines
475 B
C#
17 lines
475 B
C#
|
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;
|
||
|
OrderDescription = orderDTO.Description;
|
||
|
CustomerId = orderDTO.CustomerId;
|
||
|
TotalPrice = orderDTO.Products.Select(product => product.Price).Sum();
|
||
|
}
|
||
|
}
|