Interface IStorageService
- Namespace
- Csra.Interfaces
- Assembly
- Csra.dll
public interface IStorageService : IServiceBase
- Inherited Members
Properties
Count
Gets the number of key/value pairs contained in the storage.
int Count { get; }
Property Value
Keys
Gets a collection containing the keys in the storage.
IEnumerable<string> Keys { get; }
Property Value
Methods
AddOrUpdate<T>(string, T)
Adds a key/value pair to the storage if the key does not already exist, or updates the value for an existing key.
void AddOrUpdate<T>(string key, T value)
Parameters
keystringThey key to be added or whose value should be updated.
valueTThe value of the element to add, or update.
Type Parameters
T
ContainsKey<T>(string)
Determines whether the storage contains the specified key for the given type.
bool ContainsKey<T>(string key)
Parameters
keystringThe key to locate in the storage.
Returns
Type Parameters
TThe type of the value to check.
Remove<T>(string)
Removes the value with the specified key from the storage for the given type.
bool Remove<T>(string key)
Parameters
keystringThe key of the element to remove.
Returns
Type Parameters
TThe type of the value to remove.
TryGetValue<T>(string, out T)
Gets the type-safe value associated with the specified key.
bool TryGetValue<T>(string key, out T value)
Parameters
keystringThe key of the value to get.
valueTWhen this methods returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed unintialized.
Returns
Type Parameters
TThe type of object to retrieve.