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