public static void EFCreateUpdateAndRemoveMarket() { EF_TP2_52D_14_1920i.Market newM = new EF_TP2_52D_14_1920i.Market(); newM.code = 444; newM.description = "Description 4"; newM.name = "Market 4"; EF.CreateMarket(newM); EF_TP2_52D_14_1920i.Market m = (EF_TP2_52D_14_1920i.Market)EF.Markets.Find(444); m.description = "This is the new description"; m.name = "IphoneMarket"; EF.UpdateMarket(m); EF.DeleteMarket(EF.Markets.Find(444)); }
private void InsertMarket() { Console.WriteLine("InsertMarket()"); Console.WriteLine(); Console.WriteLine("Insert a code, description and name:"); string str = Console.ReadLine(); string[] param = str.Split(' '); IMarket market; if (ctx.Equals("1")) { market = new EF_TP2_52D_14_1920i.Market(); } else { market = new TypesProject.model.Market(); } market.code = Int32.Parse(param[0]); market.description = param[1]; market.name = param[2]; context.CreateMarket(market); Console.WriteLine("Market created successfully"); }