示例#1
0
 public void TestC()
 {
     using (var db = new PracticeDbContext())
     {
         var sumValuesForOtherId = db.TblA.ToList();
     }
 }
示例#2
0
 public void TestA()
 {
     using (var db = new PracticeDbContext())
     {
         var tblAs = db.TblA.ToList();
     }
 }
示例#3
0
 public void TestB()
 {
     using (var db = new PracticeDbContext())
     {
         var sumValuesForOtherId = db.SumValuesForOtherId.ToList();
         Assert.Equal(9, sumValuesForOtherId.FirstOrDefault(e => e.SomeOtherId == 1).SumOfValuesForOtherId);
         Assert.Equal(14, sumValuesForOtherId.FirstOrDefault(e => e.SomeOtherId == 2).SumOfValuesForOtherId);
         Assert.Equal(6, sumValuesForOtherId.FirstOrDefault(e => e.SomeOtherId == 3).SumOfValuesForOtherId);
     }
 }