コード例 #1
0
        public async Task <IActionResult> AddMovies(Movies newMovies)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Index"));
            }
            var successful = await _moviesService.AddMoviesAsync(newMovies);

            if (!successful)
            {
                return(BadRequest("Could not add item"));
            }
            return(RedirectToAction("Index"));
        }