示例#1
0
        /// <summary>
        /// Delet Person
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        // POST: api/Person
        public HttpResponseMessage Post([FromBody] Person value)
        {
            PersonTable personTable = new PersonTable();
            long        id;

            id       = personTable.SavePerson(value);
            value.ID = id;
            //create a response and call it a Post-response object
            HttpResponseMessage Response = Request.CreateResponse(System.Net.HttpStatusCode.Created);

            //set header up for the resouce just created
            Response.Headers.Location = new Uri(Request.RequestUri, string.Format("person/{0}", id));
            return(Response);
        }