コード例 #1
0
        public IQueryable<Model.BookCategory> GetAllBooksGroupedByCategory()
        {
            BookCategory category = new BookCategory()
            {
                CategoryId = "CATE1",
                CategoryName = "Category 1",
                Books = new List<Book>()
                {
                    new Book() { ID = "BOOK1"},
                    new Book() { ID = "BOOK2"}
                }
            };

            return  new List<BookCategory>()
            {
                category
            }.AsQueryable();
        }
コード例 #2
0
 public CategoryViewModelBuilder(BookCategory model)
 {
     Mapper.CreateMap<BookCategory, CategoryViewModel>();
     Mapper.CreateMap<Book, ProductViewModel>();
     _model = model;
 }