public HttpResponseMessage CreatePerson(PersonModel person) { int id = 0; PersonBAL BAL = new PersonBAL(); id = BAL.SavePerson(person); return(new HttpResponseMessage(HttpStatusCode.Created) { Content = new ObjectContent <int>(id, new XmlMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/xml")) }); }