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)); }
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); })); } }