public IHttpActionResult GetPostModel([FromUri]PostBindingModel model) { if(!this.ModelState.IsValid) { return this.BadRequest(this.ModelState); } Post post = new Post(model.Name, model.Rating); return this.Ok(post); }
public IHttpActionResult Post(string name, int rating) { Post post = new Post(name, rating); return this.Ok(new PostViewModel() { Name = post.Name, Rating = post.Rating, Author = "Some Author", AnswersCount = 17 }); }
public Post Get(string name) { Post post = new Post(name); return post; }
public Post Post() { Post post = new Post(); return post; }