public void Post(PersonItem value) { using (BuySellBidsContext myDB = new BuySellBidsContext()) { myDB.PersonItems.Add(value); myDB.SaveChanges(); } }
public void Put(int id, PersonItem value) { PersonItem PersonItemToUpdate; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PersonItemToUpdate = myDB.PersonItems.Where(t => t.PersonItemId == id).First(); myDB.PersonItems.Update(PersonItemToUpdate); myDB.SaveChanges(); } }