コード例 #1
0
ファイル: BasicTest.cs プロジェクト: johannbrink/EF6Auditing
 public void TestMethod1()
 {
     var myDbContext = new MyDbContext();
     myDbContext.Database.Initialize(true);
     var customer = new MyCustomer
     {
         CustomerName = "Test1",
         CreatedDate = DateTime.Now,
         Location = ConvertLatLonToDbGeography(-26.1167132503074, 28.0013997014612)
     };
     myDbContext.MyCustomers.Add(customer);
     myDbContext.SaveChanges("TestUser");
     customer.CustomerName = "Test2";
     customer.Location = ConvertLatLonToDbGeography(-24.1167132503074, 26.0013997014612);
     myDbContext.SaveChanges("TestUser");
 }
コード例 #2
0
        public void TestMethod1()
        {
            var myDbContext = new MyDbContext();

            myDbContext.Database.Initialize(true);
            var customer = new MyCustomer
            {
                CustomerName = "Test1",
                CreatedDate  = DateTime.Now,
                Location     = ConvertLatLonToDbGeography(-26.1167132503074, 28.0013997014612)
            };

            myDbContext.MyCustomers.Add(customer);
            myDbContext.SaveChanges("TestUser");
            customer.CustomerName = "Test2";
            customer.Location     = ConvertLatLonToDbGeography(-24.1167132503074, 26.0013997014612);
            myDbContext.SaveChanges("TestUser");
        }