public async Task <ActionResult <TEntity> > GetById(int id) { var entity = await service.GetByIdAsync(id); if (entity == null) { return(NotFound()); } return(entity); }