我正在Rest-API
中创建一个Asp.net core
并面临一个乏味的问题。
我每次put/patch
时都要验证自己的数据。
SupplyOrderState
发生更改时,数据将被更新。
每次我必须检查
,
public class SupplyOrder : BaseEntity
{
public long SupplierId { get; set; }
public Supplier Supplier { get; set; }
public DateTime CreationDate { get; set; }
public DateTime? DeliveredDate { get; set; }
public DateTime? CancellationDate { get; set; }
public long CostCenterId { get; set; }
public CostCenter CostCenter { get; set; }
public SupplyOrderStates SupplyOrderStates { get; set; }
public string ApproverUserId { get; set; }
public ApplicationUser ApproverUser { get; set; }
public string CancellerUserId { get; set; }
public ApplicationUser CancellerUser { get; set; }
public string ReceiverUserId { get; set; }
public ApplicationUser ReceiverUser { get; set; }
public ICollection<SupplyOrderDetail> SupplyOrderDetails { get; set; }
public ICollection<SupplyTransportationDocument> SupplyTransportationDocuments { get; set; }
}
public enum SupplyOrderStates
{
preApproved = 0,
approved = 1,
notApproved = 2,
delivered = 3,
partialDelivered = 4,
cancled = 5
}