Exemplo n.º 1
0
 public int PostParkWays([FromBody] Directory_ParkWays value)
 {
     try
     {
         this.ef_dir.Add(value);
         return(ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Exemplo n.º 2
0
 public int PutParkWays(int id, [FromBody] Directory_ParkWays value)
 {
     try
     {
         this.ef_dir.Update(value);
         return(this.ef_dir.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Exemplo n.º 3
0
 public IHttpActionResult GetParkWaysOfID(int id)
 {
     try
     {
         Directory_ParkWays ens = this.ef_dir
                                  .Context
                                  .Where(w => w.id == id)
                                  .ToList()
                                  .Select(m => m.GetDirectory_ParkWays_Directory_Ways()).FirstOrDefault();
         return(Ok(ens));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }