public async Task <IActionResult> Delete(int id) { var item = await _base_repository_rental.GetById(id); if (item != null) { await _base_repository_rental.Remove(item); return(NoContent()); } return(NoContent()); }
public async Task <ActionResult <Event> > Delete(int id) { try { var item = await _eventRepository.GetById(id); if (item != null) { await _eventRepository.Remove(item); return(Ok()); } return(NotFound()); } catch (Exception ex) { _logger.LogError(ex, $"{LocalLog} [Delete] [Id: {id}]"); throw ex; } }