Table of Contents

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

int

Keys

Gets a collection containing the keys in the storage.

IEnumerable<string> Keys { get; }

Property Value

IEnumerable<string>

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

key string

They key to be added or whose value should be updated.

value T

The 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

key string

The key to locate in the storage.

Returns

bool

true if the storage contains an element with the specified key; otherwise, false.

Type Parameters

T

The 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

key string

The key of the element to remove.

Returns

bool

true if the element is successfully found and removed; otherwise false.

Type Parameters

T

The 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

key string

The key of the value to get.

value T

When 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

bool

true if the storage contains an element with the specified key; otherwise, false.

Type Parameters

T

The type of object to retrieve.