public ActionResult Index(BooksListSuccessMessage message = BooksListSuccessMessage.None)
 {
     var books = new BookRepository().GetAll();
     var model = Mapper.Map<IEnumerable<Book>, BooksListModel>(books);
     if (message != BooksListSuccessMessage.None)
         model.SuccessMessage = message.GetDescriptionAttributeValue();
     return View(model);
 }
Esempio n. 2
0
        public ActionResult Index(BooksListSuccessMessage message = BooksListSuccessMessage.None)
        {
            var books = new BookRepository().GetAll();
            var model = Mapper.Map <IEnumerable <Book>, BooksListModel>(books);

            if (message != BooksListSuccessMessage.None)
            {
                model.SuccessMessage = message.GetDescriptionAttributeValue();
            }
            return(View(model));
        }
 public ActionResult Index(BooksListSuccessMessage message = BooksListSuccessMessage.None)
 {
     var books = new BookRepository().GetAll();
     var model = new BooksListModel
     {
         Books = GetBooksListModels(books)
     };
     if (message != BooksListSuccessMessage.None)
         model.SuccessMessage = message.GetDescriptionAttributeValue();
     return View(model);
 }
Esempio n. 4
0
        public ActionResult Index(BooksListSuccessMessage message = BooksListSuccessMessage.None)
        {
            var books = new BookRepository().GetAll();
            var model = new BooksListModel
            {
                Books = GetBooksListModels(books)
            };

            if (message != BooksListSuccessMessage.None)
            {
                model.SuccessMessage = message.GetDescriptionAttributeValue();
            }
            return(View(model));
        }