public async Task <ActionResult <Result> > Delete(int id) { var result = await workoutService.Delete(id); if (!result.Succeeded) { return(BadRequest(result.Errors)); } return(result); }
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 })); } }
public IActionResult Delete(int id) { _workoutService.Delete(id); return(Ok()); }
public async Task <IActionResult> Delete(int id) { await _workoutService.Delete(id); return(Ok()); }