コード例 #1
0
 public HttpResponseMessage SaveSample2(SampleViewModel model)
 {
     return this.Request.CreateResponse(HttpStatusCode.OK, model);
 }
コード例 #2
0
        public HttpResponseMessage SaveSample(SampleViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, this.ModelState);
            }

            return this.Request.CreateResponse(HttpStatusCode.OK, model);
        }