public HttpResponseMessage SelectAll() { ItemsResponse <BlogTag> response = new ItemsResponse <BlogTag>(); response.Items = BlogTagService.SelectAll(); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public HttpResponseMessage Delete(int id) { BlogTagService.Delete(id); SuccessResponse response = new SuccessResponse(); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public HttpResponseMessage SelectById([FromUri] string searchString) { ItemsResponse <BlogTag> response = new ItemsResponse <BlogTag>(); response.Items = BlogTagService.search(searchString); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public HttpResponseMessage SelectById(int id) { ItemResponse <BlogTag> response = new ItemResponse <BlogTag>(); response.Item = BlogTagService.SelectById(id); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public HttpResponseMessage Update(BlogTagUpdateRequest model) { if (!ModelState.IsValid) { return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState)); } BlogTagService.Update(model); SuccessResponse response = new SuccessResponse(); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public HttpResponseMessage Add(BlogTagAddRequest model) { if (!ModelState.IsValid) { return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState)); } ItemResponse <int> response = new ItemResponse <int>(); response.Item = BlogTagService.Insert(model); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public BlogTagController(BlogTagService service) { _service = service; }