private static void storeOwnerContentsAsCollections(Dictionary<string, List<RequestResourceUsage>> ownerGroupedUsages) { var allKeys = ownerGroupedUsages.Keys; foreach (var ownerKey in allKeys) { IContainerOwner owner; if (ownerKey.StartsWith(SystemSupport.SystemOwnerRoot)) owner = TBSystem.CurrSystem; else owner = VirtualOwner.FigureOwner(ownerKey); var ownerContent = ownerGroupedUsages[ownerKey]; var firstRangeItem = ownerContent[0]; var lastRangeItem = ownerContent[ownerContent.Count - 1]; string collName = String.Format("{0}_{1}", firstRangeItem.ProcessorUsage.TimeRange.EndTime.ToString( "yyyyMMddHHmmssfff"), lastRangeItem.ProcessorUsage.TimeRange.EndTime.ToString( "yyyyMMddHHmmssfff")); //var existing = RequestResourceUsageCollection.RetrieveFromOwnerContent(owner, collName); //if (existing != null) // continue; RequestResourceUsageCollection ownerCollection = new RequestResourceUsageCollection(); ownerCollection.SetLocationAsOwnerContent(owner, collName); ownerCollection.CollectionContent = ownerContent; ownerCollection.StoreInformation(null, true); } }