public static Warehouse ToEntity(this UpdatedWarehouse updatedWarehouse) { return(new Warehouse() { Id = updatedWarehouse.Id , Name = updatedWarehouse.Name , Description = updatedWarehouse.Description , CreationDate = updatedWarehouse.CreateDate }); }
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()); } }
public RegisteredWarehouse Update(UpdatedWarehouse updatedWarehouse) { updatedWarehouse.CreateDate = DateTime.Now; return(this._warehouseService.Update(updatedWarehouse)); }