How do I initialize a collection of 'Quote' objects based on the class shown below where 'Quote' would contain a collection of at least 5 'Rate' objects.
List<Quote> quotes = new List<Quote> {new Quote { Id = 1, (need 5 Rate objects in here) } }
public class Quote
{
public int Id { get; set; }
public List<Rate> Rates { get; set; }
}
public class Rate
{
public int Id { get; set; }
public string AccommodationType { get; set; }
public decimal Price { get; set; }
}
Use a factory method to create such object graphs for you.