コード例 #1
0
        public static void Main(string[] args)
        {
            var esCtx = new ESContext();

            esCtx.Computers.Add(new Computer()
            {
                Description = "TEST", CoolingType = "NONE", Price = 333, Weight = 3
            });
            esCtx.SaveChanges();

            var tsCtx = new TSContext();

            tsCtx.Computers.Add(new TSComputer()
            {
                Description = "TEST",
                CoolingType = "NONE",
                Price       = 333,
                Weight      = 2,
                Server      = new Server()
                {
                    BandWidth = 100
                }
            });
            tsCtx.SaveChanges();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: MichealRG/Lab5
        static void Main(string[] args)
        {
            var ctx = new Context();

            ctx.Computers.Add(new Computer()
            {
                Description = "Test Laptop", CoolingType = "Air", Weight = 2, Price = 1500
            });
            ctx.SaveChanges();
            //zrobione ES entitySpliting idk sam sie przydziela, jeden entity podzielony na dwie rzone tabele
            var ts = new TSContext();

            ts.Computers.Add(new ComputerTS()
            {
                Description = "Test Laptop",
                CoolingType = "Air",
                Weight      = 2,
                Price       = 1500,
                Server      = new Server()
                {
                    BandWidth = 1000
                }                                          //musi byc seerver bo ustawiony hasRequired
            });

            ts.SaveChanges();
            Console.WriteLine("Ready");
            Console.ReadKey();
        }