Domain model for order management with items, addresses, and payments.
// Source: https://github.com/aspnetrun/run-aspnetcore-microservices | License: MIT | Copyright 2019 aspnetrun
// Provided via justclaw.it.com; keep this notice with the code.
namespace Ordering.Domain.Models;
public class Order : Aggregate<OrderId>
{
private readonly List<OrderItem> _orderItems = new();
public IReadOnlyList<OrderItem> OrderItems => _orderItems.AsReadOnly();
public CustomerId CustomerId { get; private set; } = default!;
public OrderName OrderName { get; private set; } = default!;
public Address ShippingAddress { get; private set; } = default!;
public Address BillingAddress { get; private set; } = default!;
public Payment Payment { get; private set; } = default!;
public OrderStatus Status { get; private set; } = OrderStatus.Pending;
pub
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key