Changeset 2802 for branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStore.cs
- Timestamp:
- 02/15/10 15:41:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.Services.Deployment.DataAccess/PluginStore.cs
r2771 r2802 50 50 if (pluginEntity.PluginPackage == null) { 51 51 // insert 52 pluginEntity.PluginPackage = MakePluginPackage(plugin Description, pluginPackage);52 pluginEntity.PluginPackage = MakePluginPackage(pluginEntity, pluginPackage); 53 53 } else { 54 54 // update … … 104 104 } 105 105 106 product.Id = productEntity.Id;107 108 106 DeleteOldPlugins(ctx, productEntity); 109 107 … … 112 110 ProductPlugin prodPlugin = new ProductPlugin(); 113 111 prodPlugin.PluginId = existingPlugin.Id; 114 prodPlugin.ProductId = product .Id;112 prodPlugin.ProductId = productEntity.Id; 115 113 ctx.ProductPlugins.InsertOnSubmit(prodPlugin); 116 114 } … … 146 144 if (pluginDescriptions.ContainsKey(pluginEntity)) pluginDescriptions.Remove(pluginEntity); 147 145 148 pluginDescription.Id = pluginEntity.Id;149 150 146 DeleteOldDependencies(ctx, pluginEntity); 151 147 … … 153 149 var dependencyEntity = GetExistingPlugin(ctx, dependency.Name, dependency.Version); 154 150 Dependency d = new Dependency(); 155 d.PluginId = plugin Description.Id;151 d.PluginId = pluginEntity.Id; 156 152 d.DependencyId = dependencyEntity.Id; 157 153 ctx.Dependencies.InsertOnSubmit(d); … … 173 169 #region product <-> productDescription transformation 174 170 private ProductDescription MakeProductDescription(PluginStoreClassesDataContext ctx, Product p, IQueryable<Plugin> plugins) { 175 var desc = new ProductDescription(p. Id, p.Name, new Version(p.Version), from plugin in plugins176 171 var desc = new ProductDescription(p.Name, new Version(p.Version), from plugin in plugins 172 select MakePluginDescription(ctx, plugin)); 177 173 return desc; 178 174 } 179 175 private Product MakeProductFromDescription(ProductDescription desc) { 180 176 var product = new Product(); 181 product.Id = desc.Id;182 177 product.Name = desc.Name; 183 178 product.Version = desc.Version.ToString(); … … 192 187 if (!pluginDescriptions.ContainsKey(plugin)) { 193 188 // no cached description -> create new 194 var desc = new PluginDescription(plugin. Id, plugin.Name, new Version(plugin.Version), from dep in GetDependencies(ctx, plugin)195 189 var desc = new PluginDescription(plugin.Name, new Version(plugin.Version), from dep in GetDependencies(ctx, plugin) 190 select MakePluginDescription(ctx, dep)); 196 191 pluginDescriptions[plugin] = desc; 197 192 } … … 201 196 private Plugin MakePluginFromDescription(PluginDescription pluginDescription) { 202 197 var plugin = new Plugin(); 203 plugin.Id = pluginDescription.Id;204 198 plugin.Name = pluginDescription.Name; 205 199 plugin.Version = pluginDescription.Version.ToString(); … … 207 201 } 208 202 209 private PluginPackage MakePluginPackage(Plugin Description pluginDescription, byte[] pluginPackage) {203 private PluginPackage MakePluginPackage(Plugin plugin, byte[] pluginPackage) { 210 204 var package = new PluginPackage(); 211 205 package.Data = pluginPackage; 212 package.PluginId = plugin Description.Id;206 package.PluginId = plugin.Id; 213 207 package.FileName = string.Empty; 214 208 return package;
Note: See TracChangeset
for help on using the changeset viewer.