Exemple #1
0
        public async Task <IActionResult> Delete(int id)
        {
            if (ModelState.IsValid)
            {
                var serviceResponse = await SmileyRepository.Delete(id);

                return(await ForumViewResult.RedirectFromService(this, serviceResponse));
            }

            return(ForumViewResult.RedirectToReferrer(this));
        }
Exemple #2
0
        public async Task <IActionResult> Delete(int id)
        {
            if (ModelState.IsValid)
            {
                var serviceResponse = await SmileyRepository.Delete(id);

                return(await ForumViewResult.RedirectFromService(this, serviceResponse, FailureCallback));
            }

            return(await FailureCallback());

            async Task <IActionResult> FailureCallback()
            {
                return(await Task.Run(() => { return ForumViewResult.RedirectToReferrer(this); }));
            }
        }