public async Task <IHttpActionResult> Search([FromBody] SearchHobbyViewModel condition) { //Check model is null if (condition == null) { condition = new SearchHobbyViewModel(); Validate(condition); } //Validate model if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var loadHobbiesResult = await _hobbyService.SearchHobbiesAsync(condition, CancellationToken.None); return(Ok(loadHobbiesResult)); }