Esempio n. 1
0
 public IActionResult Delete(Guid id)
 {
     try
     {
         _playerAppService.Delete(id);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Esempio n. 2
0
        public async Task <ActionResult> Delete(Player player)
        {
            bool _result = await _playerAppService.Delete(player);

            if (_result)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
Esempio n. 3
0
        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"));
            }
        }