コード例 #1
0
 protected override void TearDown()
 {
   var db = new PerformanceTest();
   using (var ts = new TransactionScope()) {
     db.Delete(db.Simplests);
     db.SaveChanges();
     ts.Complete();
   }
 }
コード例 #2
0
 protected override void OpenSession()
 {
   context = new PerformanceTest();
 }
コード例 #3
0
 static IQueryable GetSimplestPage(PerformanceTest context, long idFrom, int pageSize)
 {
   var query = 
     from e in context.Simplests
     where e.Id >= idFrom
     select e;
   return query.Take(pageSize);
 }
コード例 #4
0
 static IQueryable GetAllSimplest(PerformanceTest context)
 {
   return context.Simplests.Where(s => s.Id > 0);
 }
コード例 #5
0
 static IQueryable GetSimplest(PerformanceTest context, long id)
 {
   var query = 
     from e in context.Simplests
     where e.Id == id
     select e;
   return query;
 }