コード例 #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var deleteGenre = await _genre.Delete(id);

            if (deleteGenre)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
コード例 #2
0
        public async Task <IActionResult> Delete(int id)
        {
            var deleteGenre = await _genre.Delete(id);

            if (deleteGenre)
            {
                Alert("Genre deleted successfully!", NotificationType.success);
                return(RedirectToAction("Index"));
            }
            Alert("Genre not deleted successfully!", NotificationType.error);
            return(View());
        }
コード例 #3
0
ファイル: GenreController.cs プロジェクト: efua-ye/CYBER_ASS
        public async Task <IActionResult> Delete(int id)
        {
            var deleteGenre = await _genre.Delete(id);

            if (deleteGenre)
            {
                return(Ok("Genre Deleted"));
            }
            else
            {
                return(BadRequest(new { message = "Unable to delete genre details" }));
            }
        }