示例#1
0
 public static Blog[] GetMsdnBlogs()
 {
     using (var db = new BloggingContext())
     {
         return db.Blogs
             .Where(b => b.Url.Contains("msdn"))
             .OrderBy(b => b.Url)
             .ToArray();
     }
 }
示例#2
0
 public static Blog[] GetBlogs()
 {
     using (var db = new BloggingContext())
     {
         return db.Blogs
             .SqlQuery("SELECT * FROM dbo.wrong_table")
             .ToArray();
     }
 }