Пример #1
0
    static void Main()
    {
        using (var dbCon = new NorthwindTwinEntities())
        {
            var shipper = new Shipper()
            {
                Phone       = "08954654",
                CompanyName = "gosho ood"
            };

            dbCon.Shippers.Add(shipper);
        }
    }
        public static void Main()
        {
            NorthwindEntities dbNorthwnd = new NorthwindEntities();
            NorthwindTwinEntities dbNorthwndtwin = new NorthwindTwinEntities();

            var employee = dbNorthwnd.Employees.Where(z => z.EmployeeID == 1).First();
            employee.FirstName = "Gosho";
            var employeeTwin = dbNorthwndtwin.Employees.Where(z => z.EmployeeID == 1).First();
            employee.FirstName = "GoshoTwin";

            dbNorthwnd.SaveChanges();
            dbNorthwndtwin.SaveChanges();
        }