I have orders and order details. I want to check all the order details in order to find out if the status of all the order details is completed. There are a couple of statuses; canceled, completed, continues. How to check the statuses in the sample below in order to know if all order details are completed?
await this._db.OrderDetails.Where(x => x.OrderId) == id);
order and details:
public class Order
{
public int Id { get; set; }
[Required]
public DateTime OrderDateTime { get; set; }
[Required]
[MaxLength(250)]
public string CustomerName { get; set; }
public string Status { get; set; }
[MaxLength(50)]
public string DoneBy { get; set; }
public List<OrderDetail> OrderDetails { get; set; }
}
public class OrderDetail
{
public int Id { get; set; }
[Required]
[MaxLength(100)]
public string ProductCode { get; set; }
[Required]
[MaxLength(250)]
public string ProductName { get; set; }
[Required]
public int BuyQuantity { get; set; }
[Required]
public int SellQuantity { get; set; }
public double CostRatio { get; set; }
public double UnitCost { get; set; }
public double TotalBuyPrice { get; set; }
public double TotalSellPrice { get; set; }
[MaxLength(150)]
public string ShippingNumber { get; set; }
public string Status { get; set; }
[MaxLength(150)]
public string TrackingNumber { get; set; }
[MaxLength(400)]
public string Description { get; set; }
public string Currency { get; set; }
public int OrderId { get; set; }
public int VendorId { get; set; }
public Order Order { get; set; }
public Vendor Vendor { get; set; }
}