private static void CreateCustomerModel() { EfInheritanceContext db = new EfInheritanceContext(); VipCustomer cc = new VipCustomer { Name = "VipCustomer", VipNum = 999 }; db.Customers.Add(cc); SupperCustomer ba = new SupperCustomer { Name = "SupperCustomer", SupperNums = 888, }; db.Customers.Add(ba); db.SaveChanges(); }
private static void CreateBillingModel() { EfInheritanceContext db = new EfInheritanceContext(); CreditCard cc = new CreditCard { CardType = CardType.CreditCard, ExpiryMonth = 11, ExpiryYear = 2015, Number = 11, Owner = "Owner" }; db.CreditCards.Add(cc); db.Billings.Add(cc); BankAccount ba = new BankAccount { BankName = "CCNC", Number = 9, Owner = "CN", Swift = 88 }; db.BankAccounts.Add(ba); BillingDetail bd = new BillingDetail { Number = 101, Owner = "Billing" }; db.Billings.Add(bd); db.SaveChanges(); }