public async Task <IHttpActionResult> AddHobby([FromBody] AddHobbyViewModel model) { //Check null for model if (model == null) { model = new AddHobbyViewModel(); Validate(model); } //Validate model if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var hobby = await _hobbyService.AddHobbyAsync(model, CancellationToken.None); return(Ok(hobby)); }