public ActionResult BooksCreate(BookModel model) { if (ModelState.IsValid) { BooksProcessor.CreateBook(model.Title, model.Price); return(View("Index")); } return(View()); }
public IActionResult ViewBooks() { var data = BooksProcessor.LoadBooks(); List <BookModel> books = new List <BookModel>(); foreach (var row in data) { books.Add(new BookModel { Title = row.Title, Price = row.Price }); } return(View(books)); }