Skip to main content

Class DataStoreAccessor

Provides access to a data store managed by a storage backend. This DataStore is a key-value store that can store data in various formats.

This DataStore implementation uses the MetaFileSystemClient to store data in a key-value store. Additionally, there are limitations on the key names that can be used. The key must be under 25 characters, contain no illegal characters, and have at least 1 character.

Namespace: Workspace.XBR.Xperiflow.Routines.Io

Assembly: Xperiflow.dll

Declaration
public class DataStoreAccessor : IDataStoreAccessor

Implements: Workspace.XBR.Xperiflow.Routines.Io.IDataStoreAccessor

Properties​

RootDir​

Declaration
public string RootDir { get; }

Methods​

Delete(string)​

Delete a key and all of its data and metadata.

Declaration
public void Delete(string key)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

WriteDataTable(DataTable)​

Writes a DataTable to the store. The table name is used as the key.

Declaration
public void WriteDataTable(DataTable dt)
Parameters​
TypeNameDescription
System.Data.DataTabledtThe DataTable to write. The DataTable.TableName is used as the key.

WriteDataTable(string, DataTable)​

Writes a DataTable to the store.

Declaration
public void WriteDataTable(string key, DataTable dt)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
System.Data.DataTabledtThe DataTable to write.

ReadDataTable(string)​

Retrieves a DataTable from the store that is associated with the key. The table name is used as the key.

Declaration
public DataTable ReadDataTable(string key)
Returns​

System.Data.DataTable

The DataTable associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

WriteText(string, string)​

Writes text to the store.

Declaration
public void WriteText(string key, string text)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
System.StringtextThe string data to write.

ReadText(string)​

Reads text from the store that is associated with the key.

Declaration
public string ReadText(string key)
Returns​

System.String

The string data associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

WriteKeyValuePairs(string, Dictionary<string, string>)​

Writes a dictionary of key value pairs to the store.

Declaration
public void WriteKeyValuePairs(string key, Dictionary<string, string> keyValuePairs)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
System.Collections.Generic.Dictionary<System.String,System.String>keyValuePairsThe key value pairs to write.

WriteKeyValuePairs(string, IEnumerable<KeyValuePair<string, string>>)​

Writes an enumerable of key value pairs to the store.

Declaration
public void WriteKeyValuePairs(string key, IEnumerable<KeyValuePair<string, string>> keyValuePairs)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair{System.String,System.String}>keyValuePairsThe key value pairs to write.

ReadKeyValuePairs(string)​

Reads a dictionary of key value pairs from the store that is associated with the key.

Declaration
public Dictionary<string, string> ReadKeyValuePairs(string key)
Returns​

System.Collections.Generic.Dictionary<System.String,System.String>

The key value pairs associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

ReadKeyValuePairsAsEnumerable(string)​

Reads an enumerable of key value pairs from the store that is associated with the key.

Declaration
public IEnumerable<KeyValuePair<string, string>> ReadKeyValuePairsAsEnumerable(string key)
Returns​

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair{System.String,System.String}>

The key value pairs associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

WriteJson(string, string)​

Writes a json string to the store.

Declaration
public void WriteJson(string key, string json)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
System.StringjsonThe json string to write.

WriteJson(string, JObject)​

Writes a json object to the store.

Declaration
public void WriteJson(string key, JObject json)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
Newtonsoft.Json.Linq.JObjectjsonThe json object to write.

WriteJson(string, JArray)​

Writes a json array to the store.

Declaration
public void WriteJson(string key, JArray jArray)
Parameters​
TypeNameDescription
System.StringkeyThe lookup key to associate with the data.
Newtonsoft.Json.Linq.JArrayjArrayThe json array to write.

WriteJson<T>(string, T)​

Declaration
public void WriteJson<T>(string key, T obj)
Parameters​
TypeName
System.Stringkey
<T>obj
Type Parameters​
  • T

ReadJsonAsString(string)​

Reads a json string from the store that is associated with the key.

Declaration
public string ReadJsonAsString(string key)
Returns​

System.String

The json data associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

ReadJsonAsJObject(string)​

Reads a json object from the store that is associated with the key.

Declaration
public JObject ReadJsonAsJObject(string key)
Returns​

Newtonsoft.Json.Linq.JObject

The json object associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

ReadJsonAsArray(string)​

Reads a json array from the store that is associated with the key.

Declaration
public JArray ReadJsonAsArray(string key)
Returns​

Newtonsoft.Json.Linq.JArray

The json array associated with the key.

Parameters​
TypeNameDescription
System.StringkeyThe lookup key associated with the data.

ReadJsonAsObject<T>(string)​

Reads a json deserializable object from the store that is associated with the key.

Declaration
public T? ReadJsonAsObject<T>(string key)
Returns​

<T>

Parameters​
TypeName
System.Stringkey
Type Parameters​
  • T

Implements​

Inherited Members​

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?