Exemplo n.º 1
0
 public long PutOutgoingCars(long id, [FromBody] OutgoingCars value)
 {
     try
     {
         this.ef_ids.Update(value);
         int res = this.ef_ids.Save();
         return(res > 0 ? value.id : res);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Exemplo n.º 2
0
 public IHttpActionResult GetOutgoingCarsOfID(long id)
 {
     try
     {
         OutgoingCars cars = this.ef_ids
                             .Context
                             .Where(s => s.id == id)
                             .ToList()
                             //.Select(c => c.GetOutgoingCars()).FirstOrDefault();
                             .Select(c => c.GetOutgoingCars_OutgoingSostav()).FirstOrDefault();
         return(Ok(cars));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }