Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private readonly Dictionary<string, BlockingCollection<ProductModel>> _cache;
- for (var i = 0; i < _numberOfInstancesPerCollection; i++)
- {
- //this collection is the TValue of the _cache
- productModelCollection.Add(new ProductModel(name, version, ProductModel.CreateFromVT(....)));
- }
- for (var i = 0; i < _numberOfInstancesPerCollection; i++)
- {
- //instance folder creation
- string instanceFolder = string.Format(.... i + 1);
- Directory.CreateDirectory(instanceFolder);
- //package resource files is created on disk
- foreach (Package package in packageList)
- {
- string localFilePathPerInstance = string.Format("{0}\{1}", instanceFolder, package.Filename);
- File.WriteAllBytes(localFilePathPerInstance, package.Data);
- }
- //create a product model from the actual package filename and add it to the cached collection
- productModelCollection.Add(new ProductModel(...., ProductModel.CreateFromVT(...., instanceFolder, vtzPackage.Filename)));
- }
- //instance folder creation
- string instanceFolder = string.Format(....);
- Directory.CreateDirectory(instanceFolder);
- //package resource files is created on disk
- foreach (Package package in packageList)
- {
- string localFilePathPerInstance = string.Format("{0}\{1}", instanceFolder, package.Filename);
- File.WriteAllBytes(localFilePathPerInstance, package.Data);
- }
- for (var i = 0; i < _numberOfInstancesPerCollection; i++)
- {
- //create a product model from the actual package filename and add it to the cached collection
- productModelCollection.Add(new ProductModel(...., ProductModel.CreateFromVT(...., instanceFolder, vtzPackage.Filename)));
- }
Add Comment
Please, Sign In to add comment