示例#1
0
 public BookInfo(int? BookId = null)
 {
   if (BookId != null)
   {
     using (var db = new BookshelfDbContext())
     {
       Book = db.Books.Where(x => x.Id == BookId).FirstOrDefault();
     }
   }
 }
示例#2
0
 public static List<Book> BooksListBySeries(Series series, Book current = null)
 {
   using (var db = new BookshelfDbContext())
   {
     return db.Books
       .Where(x => x.Series.Id == series.Id && (current == null || x.Id != current.Id))
       .OrderBy(x => x.Name)
       .ToList();
   }
 }