public async Task <IActionResult> GetAsync(int id) { if (id < 1) { return(BadRequest(new List <string> { "Id can not be less than 1." })); } var entity = await _dataService.GetByIdOrDefaultAsync(id); if (entity == null) { return(NotFound()); } return(Ok(entity)); }