I have two related lists in C #:
public class HandlingUnit
{
[StringLength(18)]
[ExcelColumn("Handling Unit")]
public String HandlingUnit { get; set; }
[ExcelColumn("Created on")]
public DateTime DateShipped { get; set; }
[ExcelColumn("Packaging materials")]
[StringLength(50)]
public String Material { get; set; }
[NotMapped]
[ExcelColumn("Material")]
public String MaterialNumber { get; set; }
}
public class Batches
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[StringLength(10)]
public String Batch { get; set; }
public decimal Quantity { get; set; }
public String Delivery { get; set; }
public String ObjectKey { get; set; }
public String Sterilizer { get; set; }
public String Material { get; set; }
[ForeignKey("Handling")]
public String HandlingUnit { get; set; }
public virtual HandlingUnits Handling {get;set;}
public int? StatusID { get; set; }
public virtual StatusHandlingUnit StatusH { get; set; }
public byte Completed { get; set; }
}
I want to verify that all the batch associated with a specific Handling Unit, I have the status = completed otherwise I would launch a false or something like that. How could I do this with Linq? Is there any possibility?