public IHttpActionResult Post(CategoryBTO categBto) { if (!ModelState.IsValid) { return(BadRequest("Not a valid model")); } CategoryLogic categ = new CategoryLogic(); var model = categ.Create(categBto); return(CreatedAtRoute("DefaultApi", new { id = model.Id }, model)); }