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.0 (1.0.1)

Syntax

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

Parameters

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

T
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).
Exceptions

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