Couchbase Lite .NET Documentation
Couchbase Lite .NET Documentation
Couchbase.Lite.Util
Extensions Class
Extensions Methods
GetCast Method
GetCast(T) Method (IDictionary(String, Object), String)
GetCast(T) Method (IReadOnlyDictionary(String, Object), String)
GetCast(T) Method (IDictionary(String, Object), String, T)
GetCast(T) Method (IReadOnlyDictionary(String, Object), String, T)
Extensions
GetCast
T
Method (IReadOnlyDictionary
String, Object
, String)
Gets the value for the given key as the given type, or the compiler default value if the value does not exist or is the incorrect type
Namespace:
Couchbase.Lite.Util
Assembly:
Couchbase.Lite (in Couchbase.Lite.dll) Version: 2.0.0-b0364
Syntax
C#
Copy
public
static
T
GetCast
<T>(
this
IReadOnlyDictionary
<
string
,
Object
>
collection
,
string
key
)
Parameters
collection
Type:
System.Collections.Generic
IReadOnlyDictionary
String
,
Object
The dictionary to operate on (implicit)
key
Type:
System
String
The key to attempt to retrieve the value for
Type Parameters
T
The type to cast the result to
Return Value
Type:
T
The fetched value, or the compiler default value if not successful
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IReadOnlyDictionary
String
,
Object
. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic)
or
Extension Methods (C# Programming Guide)
.
See Also
Reference
Extensions Class
GetCast Overload
Couchbase.Lite.Util Namespace