Get(T) Method (IDataStore, String)

Glimpse API

DataStoreExtensions Get T  Method (IDataStore, String) Glimpse API Documentation
Gets an item from store using the key and casts to <T>.

Namespace: Glimpse.Core.Extensions
Assembly: Glimpse.Core (in Glimpse.Core.dll) Version: (1.0.1)


public static T Get<T>(
	this IDataStore store,
	string key
public static T Get<T>(
	this IDataStore store,
	string key


Type: Glimpse.Core.Extensibility IDataStore
The data store instance.
Type: OnlineSystem String
The item key.
Type Parameters

The type of item to retrieve.

Return Value

An item of type T, null or an OnlineInvalidCastException is thrown depending on the type of store. Call Contains<T> first to ensure results.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDataStore. When you use instance method syntax to call this method, omit the first parameter. For more information, see OnlineExtension Methods (Visual Basic) or OnlineExtension Methods (C# Programming Guide).

OnlineSystem InvalidCastExceptionMay throw an invalid cast exception if the IDataStore item and type do not match.
See Also