Пример #1
0
        public async Task <IActionResult> DeleteAsync([FromRoute] int id)
        {
            try
            {
                await _workoutService.DeleteAsync(id);

                return(NoContent());
            }
            catch (EntityNotFoundException)
            {
                return(NotFound());
            }
        }
Пример #2
0
        public async Task <IActionResult> Delete([FromRoute] int id)
        {
            await _workoutService.DeleteAsync(id);

            return(RedirectToAction(nameof(Index)));
        }