public int PostWays([FromBody] Directory_Locomotive value) { try { this.ef_dir.Add(value); return(ef_dir.Save()); } catch (Exception e) { return(-1); } }
public int PutWays(string locomotive, [FromBody] Directory_Locomotive value) { try { this.ef_dir.Update(value); return(this.ef_dir.Save()); } catch (Exception e) { return(-1); } }
public IHttpActionResult GetLocomotiveOfID(string locomotive) { try { Directory_Locomotive ens = this.ef_dir .Context .Where(l => l.locomotive == locomotive) .ToList() .Select(m => m.GetDirectory_Locomotive()).FirstOrDefault(); return(Ok(ens)); } catch (Exception e) { return(BadRequest(e.Message)); } }