Пример #1
0
        public void ContractInsertWithIdentity([IncludeDataContexts("Oracle")] string context)
        {
            using (var db = new TestDbManager(context))
            {
                db.BeginTransaction();

                var user = new User {
                    Name = "user"
                };
                user.Id = Convert.ToInt64(db.InsertWithIdentity(user));

                db.InsertWithIdentity(new Contract {
                    UserId = user.Id, ContractNo = 1, Name = "contract"
                });
            }
        }
Пример #2
0
		public void UserInsertWithIdentity()
		{
			using (var db = new TestDbManager("Oracle"))
			{
				db.BeginTransaction();
				db.InsertWithIdentity(new User { Name = "user" });
			}
		}
Пример #3
0
		public void UserInsertWithIdentity([IncludeDataContexts("Oracle")] string context)
		{
			using (var db = new TestDbManager(context))
			{
				db.BeginTransaction();
				db.InsertWithIdentity(new User { Name = "user" });
			}
		}
Пример #4
0
 public void UserInsertWithIdentity([IncludeDataContexts("Oracle")] string context)
 {
     using (var db = new TestDbManager(context))
     {
         db.BeginTransaction();
         db.InsertWithIdentity(new User {
             Name = "user"
         });
     }
 }
Пример #5
0
 public void UserInsertWithIdentity()
 {
     using (var db = new TestDbManager("Oracle"))
     {
         db.BeginTransaction();
         db.InsertWithIdentity(new User {
             Name = "user"
         });
     }
 }
Пример #6
0
		public void IsDbGeneratedTest()
		{
			using (var db = new TestDbManager("Sql2008"))
			{
				var id = db.InsertWithIdentity(new L2SPersons
				{
					FirstName = "Test",
					LastName  = "Test",
					Gender    = "M"
				});

				db.GetTable<L2SPersons>().Delete(p => p.PersonID == ConvertTo<int>.From(id));
			}
		}
Пример #7
0
        public void IsDbGeneratedTest()
        {
            using (var db = new TestDbManager("Sql2008"))
            {
                var id = db.InsertWithIdentity(new L2SPersons
                {
                    FirstName = "Test",
                    LastName  = "Test",
                    Gender    = "M"
                });

                db.GetTable <L2SPersons>().Delete(p => p.PersonID == ConvertTo <int> .From(id));
            }
        }
Пример #8
0
		public void IsDbGeneratedTest([IncludeDataContexts("Sql2008", "Sql2012")] string context)
		{
			using (var db = new TestDbManager(context))
			{
				db.BeginTransaction();

				var id = db.InsertWithIdentity(new L2SPersons
				{
					FirstName = "Test",
					LastName  = "Test",
					Gender    = "M"
				});

				db.GetTable<L2SPersons>().Delete(p => p.PersonID == ConvertTo<int>.From(id));
			}
		}
Пример #9
0
        public void ContractLinqManyInsert()
        {
            using (var db = new TestDbManager("Oracle"))
            {
                db.BeginTransaction();

                var user = new User {
                    Name = "user"
                };
                user.Id = Convert.ToInt64(db.InsertWithIdentity(user));

                db.GetTable <User>().Insert(db.GetTable <Contract>(), x => new Contract {
                    UserId = x.Id, ContractNo = 1, Name = "contract"
                });
            }
        }
Пример #10
0
        public void ContractInsert()
        {
            using (var db = new TestDbManager("Oracle"))
            {
                db.BeginTransaction();

                var user = new User {
                    Name = "user"
                };
                user.Id = Convert.ToInt64(db.InsertWithIdentity(user));

                db.Insert(new Contract {
                    UserId = user.Id, ContractNo = 1, Name = "contract1"
                });
            }
        }
Пример #11
0
        public void IsDbGeneratedTest([IncludeDataContexts("Sql2008", "Sql2012")] string context)
        {
            using (var db = new TestDbManager(context))
            {
                db.BeginTransaction();

                var id = db.InsertWithIdentity(new L2SPersons
                {
                    FirstName = "Test",
                    LastName  = "Test",
                    Gender    = "M"
                });

                db.GetTable <L2SPersons>().Delete(p => p.PersonID == ConvertTo <int> .From(id));
            }
        }
Пример #12
0
		public void ContractInsert()
		{
			using (var db = new TestDbManager("Oracle"))
			{
				db.BeginTransaction();

				var user = new User { Name = "user" };
				user.Id = Convert.ToInt64(db.InsertWithIdentity(user));

				db.Insert(new Contract { UserId = user.Id, ContractNo = 1, Name = "contract1" });
			}
		}
Пример #13
0
		//[Test]
		public void ContractLinqManyInsertWithIdentity()
		{
			using (var db = new TestDbManager("Oracle"))
			{
				db.BeginTransaction();

				var user = new User { Name = "user" };
				user.Id = Convert.ToInt64(db.InsertWithIdentity(user));

				db.GetTable<User>().InsertWithIdentity(db.GetTable<Contract>(), x => new Contract
				{
					UserId = x.Id, ContractNo = 1, Name = "contract"
				});
			}
		}
Пример #14
0
		public void ContractLinqInsertWithIdentity([IncludeDataContexts("Oracle")] string context)
		{
			using (var db = new TestDbManager(context))
			{
				db.BeginTransaction();

				var user = new User { Name = "user" };
				user.Id = Convert.ToInt64(db.InsertWithIdentity(user));

				db.GetTable<Contract>().InsertWithIdentity(() => new Contract { UserId = user.Id, ContractNo = 1, Name = "contract" });
			}
		}