public int PutCargoGNG(int code, [FromBody] Directory_CargoGNG value) { try { this.ef_dir.Update(value); return(this.ef_dir.Save()); } catch (Exception e) { return(-1); } }
public int PostCargoGNG([FromBody] Directory_CargoGNG value) { try { this.ef_dir.Add(value); int res = ef_dir.Save(); return(res > 0 ? value.id : res); } catch (Exception e) { return(-1); } }
public IHttpActionResult GetCargoGNGOfID(int id) { try { Directory_CargoGNG ens = this.ef_dir .Context .Where(w => w.id == id) .ToList() .Select(m => m.GetDirectory_CargoGNG()).FirstOrDefault(); return(Ok(ens)); } catch (Exception e) { return(BadRequest(e.Message)); } }