Esempio n. 1
0
 public RegisteredCategory Update(UpdateCategory updateRegistry)
 {
     using (LogisticDataContext logisticDataContext = new LogisticDataContext())
     {
         var categoryToUpdate = updateRegistry.ToEntity();
         logisticDataContext.Categories.Attach(categoryToUpdate);
         logisticDataContext.Entry(categoryToUpdate).State = System.Data.Entity.EntityState.Modified;
         logisticDataContext.SaveChanges();
         return(categoryToUpdate.toDTO());
     }
 }
Esempio n. 2
0
 public RegisteredProduct Update(UpdateProduct updateRegistry)
 {
     using (LogisticDataContext logisticDataContext = new LogisticDataContext())
     {
         var productToEntity = updateRegistry.ToEntity();
         logisticDataContext.Products.Attach(productToEntity);
         logisticDataContext.Entry(productToEntity).State = System.Data.Entity.EntityState.Modified;
         logisticDataContext.SaveChanges();
         return(productToEntity.toDTO());
     }
 }
Esempio n. 3
0
 public RegisteredWarehouse Update(UpdatedWarehouse updateRegistry)
 {
     using (LogisticDataContext logisticDataContext = new LogisticDataContext())
     {
         var wareHouseEntity = updateRegistry.ToEntity();
         logisticDataContext.Warehouses.Attach(wareHouseEntity);
         logisticDataContext.Entry(wareHouseEntity).State = System.Data.Entity.EntityState.Modified;
         logisticDataContext.SaveChanges();
         return(wareHouseEntity.toDTO());
     }
 }