static void Main(string[] args) { MyRepo repo = new MyRepo(); Console.WriteLine(repo.GetCustomers().Count()); foreach (Customers c in repo.GetCustomers()) { Console.WriteLine(c.Orders.Count()); } }
public void SaveCustomer() { Entities en = new data.Entities(); en.AddToCustomers(new Customers { FirstName = @"Chuck", LastName = @"Norris" }); en.SaveChanges(); Console.WriteLine(@"Saved a new record!"); MyRepo repo = new MyRepo(); }