Beispiel #1
0
 // POST: api/ControladorPrincipal
 public HttpResponseMessage Post([FromBody]Persona_Jorge Insertar)
 {
     int resp = 0;
     HttpResponseMessage msj = null;
     try
     {
         using (practicantesEntities1 entities = new practicantesEntities1())
         {
             entities.Entry(Insertar).State = System.Data.Entity.EntityState.Added;
             resp = entities.SaveChanges();
             msj = Request.CreateResponse(HttpStatusCode.OK, resp);
         }
     }
     catch (Exception exe)
     {
         msj = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exe.Message);
     }
     return msj;
 }