示例#1
0
        public HttpResponseMessage GetAllLibraryBooksForACategory(LibraryBookCategory category)
        {
            var libraryService = new LibraryService();

            IEnumerable<ILibraryBook> books = libraryService.AllBooks(category);

            return Request.CreateResponse(HttpStatusCode.OK, books);
        }
        private bool IsNonFiction(LibraryBookCategory category)
        {
            switch (category)
            {
            case LibraryBookCategory.Biography:
                return(true);

            default:
                return(false);
            }
        }
示例#3
0
 public IEnumerable <ILibraryBook> GetAllLibraryBooksForACategory(LibraryBookCategory category)
 {
     return(_libraryService.AllBooks(category));
 }
示例#4
0
 public IEnumerable <ILibraryBook> AllBooks(LibraryBookCategory category)
 {
     return(_books.Where(lb => lb.Category == category));
 }
示例#5
0
 public IEnumerable<ILibraryBook> AllBooks(LibraryBookCategory category)
 {
     return _books.Where(lb => lb.Category == category);
 }