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
public class DataStoreAccessor : IDataStoreAccessor
Implements: Workspace.XBR.Xperiflow.Routines.Io.IDataStoreAccessor
Properties
RootDir
public string RootDir { get; }
Methods
Delete(string)
Delete a key and all of its data and metadata.
public void Delete(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
WriteDataTable(DataTable)
Writes a DataTable to the store. The table name is used as the key.
public void WriteDataTable(DataTable dt)
Parameters
Type | Name | Description |
---|---|---|
System.Data.DataTable | dt | The DataTable to write. The DataTable.TableName is used as the key. |
WriteDataTable(string, DataTable)
Writes a DataTable to the store.
public void WriteDataTable(string key, DataTable dt)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
System.Data.DataTable | dt | The 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.
public DataTable ReadDataTable(string key)
Returns
System.Data.DataTable
The DataTable associated with the key.
System.Data.DataTable
The DataTable associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
WriteText(string, string)
Writes text to the store.
public void WriteText(string key, string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
System.String | text | The string data to write. |
ReadText(string)
Reads text from the store that is associated with the key.
public string ReadText(string key)
Returns
System.String
The string data associated with the key.
System.String
The string data associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
WriteKeyValuePairs(string, Dictionary<string, string>)
Writes a dictionary of key value pairs to the store.
public void WriteKeyValuePairs(string key, Dictionary<string, string> keyValuePairs)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
System.Collections.Generic.Dictionary<System.String,System.String> | keyValuePairs | The key value pairs to write. |
WriteKeyValuePairs(string, IEnumerable<KeyValuePair<string, string>>)
Writes an enumerable of key value pairs to the store.
public void WriteKeyValuePairs(string key, IEnumerable<KeyValuePair<string, string>> keyValuePairs)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair{System.String,System.String}> | keyValuePairs | The key value pairs to write. |
ReadKeyValuePairs(string)
Reads a dictionary of key value pairs from the store that is associated with the key.
public Dictionary<string, string> ReadKeyValuePairs(string key)
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
The key value pairs associated with the key.
System.Collections.Generic.Dictionary<System.String,System.String>
The key value pairs associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
ReadKeyValuePairsAsEnumerable(string)
Reads an enumerable of key value pairs from the store that is associated with the key.
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.
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair{System.String,System.String}>
The key value pairs associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
WriteJson(string, string)
Writes a json string to the store.
public void WriteJson(string key, string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
System.String | json | The json string to write. |
WriteJson(string, JObject)
Writes a json object to the store.
public void WriteJson(string key, JObject json)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
Newtonsoft.Json.Linq.JObject | json | The json object to write. |
WriteJson(string, JArray)
Writes a json array to the store.
public void WriteJson(string key, JArray jArray)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key to associate with the data. |
Newtonsoft.Json.Linq.JArray | jArray | The json array to write. |
WriteJson<T>(string, T)
public void WriteJson<T>(string key, T obj)
Parameters
Type | Name |
---|---|
System.String | key |
<T> | obj |
Type Parameters
T
ReadJsonAsString(string)
Reads a json string from the store that is associated with the key.
public string ReadJsonAsString(string key)
Returns
System.String
The json data associated with the key.
System.String
The json data associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
ReadJsonAsJObject(string)
Reads a json object from the store that is associated with the key.
public JObject ReadJsonAsJObject(string key)
Returns
Newtonsoft.Json.Linq.JObject
The json object associated with the key.
Newtonsoft.Json.Linq.JObject
The json object associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
ReadJsonAsArray(string)
Reads a json array from the store that is associated with the key.
public JArray ReadJsonAsArray(string key)
Returns
Newtonsoft.Json.Linq.JArray
The json array associated with the key.
Newtonsoft.Json.Linq.JArray
The json array associated with the key.
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The lookup key associated with the data. |
ReadJsonAsObject<T>(string)
Reads a json deserializable object from the store that is associated with the key.
public T? ReadJsonAsObject<T>(string key)
Returns
<T>
<T>
Parameters
Type | Name |
---|---|
System.String | key |
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