public long PutOutgoingSostav(long id, [FromBody] OutgoingSostav value) { try { this.ef_ids.Update(value); int res = this.ef_ids.Save(); return(res > 0 ? value.id : res); } catch (Exception e) { return(-1); } }
public IHttpActionResult GetOutgoingSostavOfID(long id) { try { OutgoingSostav sostav = this.ef_ids .Context .Where(s => s.id == id) .ToList() .Select(c => c.GetOutgoingSostav()).FirstOrDefault(); return(Ok(sostav)); } catch (Exception e) { return(BadRequest(e.Message)); } }