Save() public method

public Save ( RegistrationCatalogEntry>.IDictionary registration, CancellationToken cancellationToken ) : Task
registration RegistrationCatalogEntry>.IDictionary
cancellationToken System.Threading.CancellationToken
return Task
        public static async Task ProcessAsync(
            RegistrationKey registrationKey,
            IReadOnlyDictionary <string, IGraph> newItems,
            ShouldIncludeRegistrationPackage shouldInclude,
            StorageFactory storageFactory,
            Uri contentBaseAddress,
            int partitionSize,
            int packageCountThreshold,
            ITelemetryService telemetryService,
            CancellationToken cancellationToken)
        {
            Trace.TraceInformation("RegistrationMaker.Process: registrationKey = {0} newItems: {1}", registrationKey, newItems.Count);

            IRegistrationPersistence registration = new RegistrationPersistence(storageFactory, registrationKey, partitionSize, packageCountThreshold, contentBaseAddress);

            IDictionary <RegistrationEntryKey, RegistrationCatalogEntry> existing = await registration.Load(cancellationToken);

            Trace.TraceInformation("RegistrationMaker.Process: existing = {0}", existing.Count);

            IDictionary <RegistrationEntryKey, RegistrationCatalogEntry> delta = PromoteRegistrationKey(newItems, shouldInclude);

            Trace.TraceInformation("RegistrationMaker.Process: delta = {0}", delta.Count);
            telemetryService.TrackMetric(TelemetryConstants.RegistrationDeltaCount, (uint)delta.Count, new Dictionary <string, string>()
            {
                { TelemetryConstants.ContentBaseAddress, contentBaseAddress.AbsoluteUri }
            });

            IDictionary <RegistrationEntryKey, RegistrationCatalogEntry> resulting = Apply(existing, delta);

            Trace.TraceInformation("RegistrationMaker.Process: resulting = {0}", resulting.Count);
            await registration.Save(resulting, cancellationToken);
        }
        public static async Task Process(RegistrationKey registrationKey, IDictionary <string, IGraph> newItems, StorageFactory storageFactory, Uri contentBaseAddress, int partitionSize, int packageCountThreshold)
        {
            IRegistrationPersistence registration = new RegistrationPersistence(storageFactory, registrationKey, partitionSize, packageCountThreshold);
            IDictionary <RegistrationEntryKey, RegistrationCatalogEntry> existing = await registration.Load();

            IDictionary <RegistrationEntryKey, RegistrationCatalogEntry> delta     = PromoteRegistrationKey(newItems);
            IDictionary <RegistrationEntryKey, RegistrationCatalogEntry> resulting = Apply(existing, delta);
            await registration.Save(resulting);
        }
        public static async Task Process(RegistrationKey registrationKey, IDictionary<string, IGraph> newItems, StorageFactory storageFactory, Uri contentBaseAddress, int partitionSize, int packageCountThreshold, CancellationToken cancellationToken)
        {
            Trace.TraceInformation("RegistrationMaker.Process: registrationKey = {0} newItems: {1}", registrationKey, newItems.Count);

            IRegistrationPersistence registration = new RegistrationPersistence(storageFactory, registrationKey, partitionSize, packageCountThreshold, contentBaseAddress);

            IDictionary<RegistrationEntryKey, RegistrationCatalogEntry> existing = await registration.Load(cancellationToken);

            Trace.TraceInformation("RegistrationMaker.Process: existing = {0}", existing.Count);

            IDictionary<RegistrationEntryKey, RegistrationCatalogEntry> delta = PromoteRegistrationKey(newItems);

            Trace.TraceInformation("RegistrationMaker.Process: delta = {0}", delta.Count);
            
            IDictionary<RegistrationEntryKey, RegistrationCatalogEntry> resulting = Apply(existing, delta);

            Trace.TraceInformation("RegistrationMaker.Process: resulting = {0}", resulting.Count);
            
            await registration.Save(resulting, cancellationToken);
        }