コード例 #1
0
 private static void GetCommuteTimeViaDefiningQuery()
 {
     using (var context = new PublicationsContext())
     {
         var commutes = context.Query <TeamCommute>().ToList();
     }
 }
コード例 #2
0
 private static void ReturnRandomTypeFromRawSql()
 {
     //NOTE: if query<teamcommute> is already defined in context as a defining query,
     //you can't ALSO use it with FromSql
     using (var context = new PublicationsContext())
     {
         // var teamlist=context.Query<TeamCommute>().FromSql("select Name,TypicalCommuteTime from TeamMembers").ToList();
         var teamlist = context.Query <TeamCommute>().FromSql("EXEC GetCommuteTimes {0}", 101).ToList();
     }
 }
コード例 #3
0
 private static void PublisherQuery()
 {
     var publishers = _context.Query <Publisher>().FromSql("select name, yearincorporated from publishers");
 }