65 lines
1.4 KiB
C#
Raw Normal View History

using System;
using MediatR;
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
{
public class CreateOrderCommand
:IAsyncRequest<bool>
{
private readonly List<OrderItemDTO> _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<OrderItemDTO> OrderItems => _orderItems;
public void AddOrderItem(OrderItemDTO item)
{
_orderItems.Add(item);
}
public CreateOrderCommand()
{
_orderItems = new List<OrderItemDTO>();
}
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; }
}
}
}