public IActionResult Delete(Guid id) { try { _playerAppService.Delete(id); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <ActionResult> Delete(Player player) { bool _result = await _playerAppService.Delete(player); if (_result) { return(Ok()); } else { return(BadRequest()); } }
public async Task <IActionResult> OnPostAsync(int id) { ErrorMessage = ""; if (!ModelState.IsValid) { return(Page()); } var result = await _playerAppService.Delete(id); if (!result.IsSuccess) { ErrorMessage = result.Message; return(Page()); } else { return(RedirectToPage("/Player/Index")); } }