Пример #1
0
 public void Post(PersonItem value)
 {
     using (BuySellBidsContext myDB = new BuySellBidsContext())
     {
         myDB.PersonItems.Add(value);
         myDB.SaveChanges();
     }
 }
Пример #2
0
        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();
            }
        }