Class DataCache
Provides a in-memory, write-through cache for data loaded from a DataConnector.
public sealed class DataCache : IDisposable
- Inheritance
-
DataCache
- Implements
- Inherited Members
Constructors
DataCache(DataConnector)
Initializes a new instance of the DataCache class.
public DataCache(DataConnector connector)
Parameters
connectorDataConnectorThe source this cache is associated with.
Exceptions
- ArgumentNullException
If
connectorisnull.
Properties
Columns
Gets the cached data columns.
public ColumnCollection Columns { get; }
Property Value
- ColumnCollection
The cached columns.
Connector
Gets the source this cache is associated with.
public DataConnector Connector { get; }
Property Value
- DataConnector
The source this cache is associated with.
Loaded
Gets a value indicating whether that data from the source is loaded.
public bool Loaded { get; }
Property Value
- bool
trueif the data is loaded; otherwise,false. If the cache is cleared Loaded will also befalse
Rows
Gets the cached data rows.
public RowCollection Rows { get; }
Property Value
- RowCollection
The cached rows.
Methods
ClearCache()
public void ClearCache()
Remarks
LoadedWill return false until the cache is reloaded.
CreateCopy()
Creates a deep copy of this data cache.
public DataCache CreateCopy()
Returns
- DataCache
A new data cache that is a copy of this data cache.
Dispose()
Clean up any resources being used.
public void Dispose()
Load()
Loads the data from the associated Connector (see LoadData(out ColumnCollection, out RowCollection)).
public void Load()
Store()
Stores the data to the associated Connector (see StoreData(ColumnCollection, RowCollection)).
public void Store()