using System; using MediatR; using System.Collections.Generic; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands { public class CreateOrderCommand :IAsyncRequest { private readonly List _orderItems; public string City { get; set; } public string Street { get; set; } public string State { get; set; } public string Country { get; set; } public string ZipCode { get; set; } public string CardNumber { get; set; } public string CardHolderName { get; set; } public DateTime CardExpiration { get; set; } public string CardSecurityNumber { get; set; } public int CardTypeId { get; set; } public string BuyerFullName { get; set; } public IEnumerable OrderItems => _orderItems; public void AddOrderItem(OrderItemDTO item) { _orderItems.Add(item); } public CreateOrderCommand() { _orderItems = new List(); } public class OrderItemDTO { public int ProductId { get; set; } public string ProductName { get; set; } public decimal UnitPrice { get; set; } public decimal Discount { get; set; } public int Units { get; set; } public string PictureUrl { get; set; } } } }