LSEG Data Library for .NET

GetCacheSnapshot

Retrieve a snapshot from the live cache for the specified items.

The snapshot is a copy of the values from the cache.

By default, all fields will be copied from the cache.

Syntax

IDictionary<string, IPriceData> GetCacheSnapshot(params string[] items)

IDictionary<string, IPriceData> GetCacheSnapshot(IEnumerable<string> items, IEnumerable<string> fields = null)

Usage

The following example demonstrates how to get a snapshot from the cache.

var stream = Pricing.Definition("EUR=").GetStream();

stream.Open();

// Add one item or a list of items
stream.AddItems("MSFT.O");
stream.AddItems(new[] { "EUR=", "GBP=", "CAD=" }); 

var snapshot = stream.GetCacheSnapshot();


stream.Close();