Exemplo n.º 1
0
 protected override void TearDown()
 {
     using (var dataContext = new PerformanceTestDataContext())
     {
         dataContext.Connection.Open();
         using (dataContext.Transaction = dataContext.Connection.BeginTransaction())
         {
             dataContext.Simplests.DeleteAllOnSubmit(dataContext.Simplests);
             dataContext.SubmitChanges();
             dataContext.Transaction.Commit();
         }
     }
 }
Exemplo n.º 2
0
        protected override void InsertMultipleTest(int count)
        {
            using (_db.Transaction = _db.Connection.BeginTransaction())
            {
                for (var i = 0; i < count; i++)
                {
                    var s = new Simplest {
                        Id = i, Value = i
                    };
                    _db.Simplests.InsertOnSubmit(s);
                }

                _db.SubmitChanges();
                _db.Transaction.Commit();
            }

            InstanceCount = count;
        }