Beispiel #1
0
        public HttpResponseMessage SelectAll()
        {
            ItemsResponse <BlogTag> response = new ItemsResponse <BlogTag>();

            response.Items = BlogTagService.SelectAll();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Beispiel #2
0
        public HttpResponseMessage Delete(int id)
        {
            BlogTagService.Delete(id);

            SuccessResponse response = new SuccessResponse();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Beispiel #3
0
        public HttpResponseMessage SelectById([FromUri] string searchString)
        {
            ItemsResponse <BlogTag> response = new ItemsResponse <BlogTag>();

            response.Items = BlogTagService.search(searchString);

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Beispiel #4
0
        public HttpResponseMessage SelectById(int id)
        {
            ItemResponse <BlogTag> response = new ItemResponse <BlogTag>();

            response.Item = BlogTagService.SelectById(id);

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        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));
        }
Beispiel #7
0
 public BlogTagController(BlogTagService service)
 {
     _service = service;
 }