Пример #1
0
        public async Task <ActionResult <Result> > Delete(int id)
        {
            var result = await workoutService.Delete(id);

            if (!result.Succeeded)
            {
                return(BadRequest(result.Errors));
            }

            return(result);
        }
Пример #2
0
        public async Task <IActionResult> DeleteWorkout(long id)
        {
            var currentUserId = int.Parse(User.Identity.Name);

            try
            {
                var entity = await _workoutService.Delete(id, currentUserId);

                return(Ok(entity));
            }
            catch (Exception ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }
Пример #3
0
 public IActionResult Delete(int id)
 {
     _workoutService.Delete(id);
     return(Ok());
 }
Пример #4
0
        public async Task <IActionResult> Delete(int id)
        {
            await _workoutService.Delete(id);

            return(Ok());
        }