Exemplo n.º 1
0
        public ActionResult DeleteAndReturnJList(string name)
        {
            MyMockDataStorage.Remove(new Book()
            {
                BookName = name
            });
            var list = MyMockDataStorage.GetAll();

            return(PartialView("_BookList", list));
        }
Exemplo n.º 2
0
 public IActionResult AddBookAndReturnNewList(Book model)
 {
     if (ModelState.IsValid)
     {
         MyMockDataStorage.Add(model);
         var list = MyMockDataStorage.GetAll();
         return(PartialView("_BookList", list));
     }
     return(PartialView("_AddBook", model));
 }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            var books = MyMockDataStorage.GetAll();
            var vm    = new BookIndexVm()
            {
                Books = books
            };

            return(View(vm));
        }