public void Put(int id, [FromBody] StockPr newObj) { var oldObj = db.StockPr.Find(id); if (oldObj == null) { return; } newObj.Id = oldObj.Id; db.Entry(oldObj).CurrentValues.SetValues(newObj); db.SaveChanges(); }
public void Post(StockPr sync) { db.StockPr.Add(sync); db.SaveChanges(); }