Example #1
0
        public async Task <IActionResult> DeleteFilm(int?Id)
        {
            if (Id == null)
            {
                return(BadRequest());
            }
            POJO model = await _Film.DeleteAsync(Id);

            if (model == null)
            {
                return(NotFound());
            }
            return(Ok());
        }
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var item = await films.GetAsync(id);

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

            if (item.PosterId != null)
            {
                await posters.DeleteAsync((int)item.PosterId);
            }
            await films.DeleteAsync(item.Id);

            return(RedirectToAction(nameof(Index), "Home"));
        }