public async Task <Model> GetModelByIdAsync(int modelId) { var model = await _models.FindModelAsync(modelId); if (model == null) { throw new ResourceNotFoundException("Model not found"); } return(_mapper.Map <Model>(model)); }