Files
db-subclass-to-dto/src/Before/Order.cs
T
2026-09-16 18:39:48 +01:00

27 lines
968 B
C#

namespace Before;
/// <summary>
/// An order, backed by the database: it derives from <see cref="DbBase"/> and
/// holds a back-reference to its <see cref="Client"/> (the other end of the
/// relation). In the "after" situation this becomes a plain POCO with an
/// <c>OrderDto</c> carrying its data to the WebApp.
/// </summary>
public class Order : DbBase
{
/// <summary>Free-text description of what this order is for.</summary>
public string Description { get; set; } = string.Empty;
/// <summary>
/// Order total in cents (integer — no floating-point money). Part of the
/// persisted state, like every other scalar.
/// </summary>
public int TotalInCents { get; set; }
/// <summary>
/// The client that owns this order. Set automatically by
/// <see cref="ClientOrders"/> when the order is added to
/// <see cref="Client.Orders"/> (navigation fix-up).
/// </summary>
public Client? Client { get; set; }
}