public OhlcResolutionAdapter(OhlcResolutionAdapterContext context)
        {
            Ctx = context;

            context.EnsureDefaults();

            if (context.RequiresApiDiscovery())
            {
                context.ApplyApiProviders();
            }

            context.EnsureProvider();

            context.Network = context.Network ?? context.PrimaryApiProvider?.Network;

            SeriesId = OhlcUtilities.GetHash(context.Pair, context.TimeResolution, context.Network);

            if (StorageEnabled)
            {
                if (Ctx.MemoryStorageEnabled)
                {
                    _storageAdapters.Add(0, new OhlcResolutionDataAdapterMemory(this));
                }

                if (Ctx.DbStorageEnabled)
                {
                    _storageAdapters.Add(1, new OhlcResolutionDataAdapterDb(this));
                }
            }
            _apiAdapters.Add(0, new OhlcResolutionDataAdapterApi(this));
        }
 public OhlcResolutionAdapterContext(OhlcResolutionAdapterContext ctx)
 {
     MemoryStorageEnabled    = ctx.MemoryStorageEnabled;
     DbStorageEnabled        = ctx.DbStorageEnabled;
     StorageEnabled          = ctx.StorageEnabled;
     ApiEnabled              = ctx.ApiEnabled;
     CanDiscoverApiProviders = ctx.CanDiscoverApiProviders;
     AssetPairProviders      = ctx.AssetPairProviders;
     Network                       = ctx.Network;
     TimeResolution                = ctx.TimeResolution;
     AssetIntermediary             = ctx.AssetIntermediary;
     AssetPegged                   = ctx.AssetPegged;
     PrimaryApiProvider            = ctx.PrimaryApiProvider;
     CurrencyConversionApiProvider = ctx.CurrencyConversionApiProvider;
     NetworksForDirect             = ctx.NetworksForDirect;
     NetworksForConversion         = ctx.NetworksForConversion;
     IsDataConverted               = ctx.IsDataConverted;
     StatusEntry                   = ctx.StatusEntry;
     Network                       = ctx.Network;
     Pair              = ctx.Pair;
     PeggedEnabled     = ctx.PeggedEnabled;
     ConversionEnabled = ctx.ConversionEnabled;
     ReversalEnabled   = ctx.ReversalEnabled;
 }