Added backend skeleton, models and services
This commit is contained in:
parent
f818b2d39e
commit
9e2565d110
8 changed files with 193 additions and 4 deletions
17
models/OrderModel.cs
Normal file
17
models/OrderModel.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue