public async Task <IActionResult> RemoveAsync(int id) { var entity = await _service.GetByIdAsync(id); if (entity != null) { await _service.DeleteAsync(entity); return(NoContent()); } else { return(NotFound(id)); } }