Ejemplo n.º 1
0
 public void TestInsertWithIDReturn_ScopeIdentity()
 {
     using (var c = Connection().OpenWithTransaction())
     {
         var beer = Beer.GetSample();
         c.Insert(Beer.InsertProcScopeIdentity, beer);
         beer.VerifySample();
     }
 }
Ejemplo n.º 2
0
 public void TestInsertWithIDReturn()
 {
     using (var c = Connection().OpenWithTransaction())
     {
         var beer = Beer.GetSample();
         c.InsertAsync(Beer.InsertProc, beer).Wait();
         beer.VerifySample();
     }
 }
Ejemplo n.º 3
0
 public void TestInsertWithIDReturn_ScopeIdentity_SQL()
 {
     using (DbConnectionWrapper c = Connection().OpenWithTransaction())
     {
         var beer = Beer.GetSample();
         c.InsertSql("INSERT INTO[dbo].[Beer] ([Name], [Style]) VALUES(@Name , @Style ); SELECT SCOPE_IDENTITY() AS [Id]", beer);
         beer.VerifySample();
     }
 }
Ejemplo n.º 4
0
        public void TestInsertListWithIDReturn()
        {
            using (var c = Connection().OpenWithTransaction())
            {
                var list = new List <Beer>();
                list.Add(Beer.GetSample());
                list.Add(Beer.GetSample());

                c.InsertListAsync(Beer.InsertManyProc, list).Wait();

                foreach (var beer in list)
                {
                    beer.VerifySample();
                }
            }
        }