public async Task <ActionResult> DeleteValue([FromRoute] Guid id) { try { var deleteValueResult = await _valueService.DeleteAsync(id); if (!deleteValueResult.HasValue) { return(NotFound(id)); } return(NoContent()); } catch (Exception ex) { return(ValidationProblem(ex.Message)); } }
public async Task <IActionResult> Delete(int id) { try { var selectedValue = await _valueService.GetByIdAsync(id); if (selectedValue == null) { return(NotFound()); } var deletedValue = _valueService.DeleteAsync(id); return(NoContent()); } catch (Exception ex) { _logger.LogError(ex.Message); return(StatusCode(500)); } }