Exemplo n.º 1
0
 public bool Update(BusinessArea item)
 {
     using (var ctx = new InventoryCtx())
     {
         var ItemToUpdate = ctx.BusinessAreas.Find(item.ID);
         if (ItemToUpdate != null)
         {
             ctx.Entry(ItemToUpdate).CurrentValues.SetValues(item);
             try
             {
                 ctx.SaveChanges();
                 RaiseCollectionChanged(NotifyCollectionChangedAction.Replace);
                 return(true);
             }
             catch (Exception)
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
 }