order total: TotalInCents on both Orders, mapped into OrderDto and OrderData
yak: ordertotalincents-on-both-sides-dto-mapping-j00p
This commit is contained in:
@@ -29,6 +29,9 @@ public sealed class OrderData : DbBase
|
||||
/// <summary>Free-text description of what this order is for.</summary>
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>Order total in cents of the stored order.</summary>
|
||||
public int TotalInCents { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Foreign key to the owning client: <see cref="Guid.Empty"/> when the
|
||||
/// order has no client, or when its client had no id yet at save time —
|
||||
@@ -101,6 +104,7 @@ public class DbContext
|
||||
{
|
||||
var row = (OrderData)existing; // refresh, keep row identity
|
||||
row.Description = fresh.Description;
|
||||
row.TotalInCents = fresh.TotalInCents;
|
||||
row.ClientId = fresh.ClientId;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user