Пример #1
0
        //[HttpPost]
        //public string Index(string searchString, bool notused)
        //{
        //    return "From [HttpPost]Index: filter on " + searchString;
        //}

        // GET: Books/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var book = await booksService.GetBook(id);

            if (book == null)
            {
                return(NotFound());
            }

            return(View(book));
        }
Пример #2
0
        // GET: Books/Create
        public async Task <IActionResult> Create(int?id)
        {
            var book = await booksService.GetBook(id);

            return(View(new Purchase(book)));
        }