I have two classes :
public class Customer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public List<Product> Product { get; set; }
}
public class Product
{
public int ProductNumber { get; set; }
public string ProductColor { get; set; }
}
And one instance :
Customer Cus = new Customer()
{
FirstName = "FirstName1",
LastName = "LastName1",
Product = new List<Product>
{
new Product()
{
ProductColor = "ProductColor12",
ProductNumber = 12
},
new Product()
{
ProductColor = "ProductColor11",
ProductNumber = 11
}
}
};
I want to sort the Product List and get a Customer with a list of products sorted by ProductNumber
How to do this ?