Added backend skeleton, models and services

This commit is contained in:
Mguy13 2023-01-04 18:53:48 +01:00
parent f818b2d39e
commit 9e2565d110
8 changed files with 193 additions and 4 deletions

17
models/OrderModel.cs Normal file
View 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();
}
}