I have listA and listB.
ListA is a list of object which has an ListB object ID (foreignKey). And ListB is a list of object which has the property to OrderBy listA.
How can I order ListA by a ListB property with a simple Linq?
class OrderList
{
public void OrderByDate(List<ProductionProgress> progressList,
List<Production> productionList)
{
//Order progressList by productionList.ProductionDate
}
public class ProductionProgress
{
public int ProductionID { get; set; }
public string Progress { get; set; }
}
public class Production
{
public int ID { get; }
public string Description { get; set; }
public DateTime ProductionDate { get; set; }
}
}