Table of Contents

InstanceAs Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/Wrapper.cs

InstanceAs<TResult>()

Returns a value that is equivalent to the instance of the object that this wrapper represents.

public TResult InstanceAs<TResult>()

Returns

TResult

A value that is equivalent to the instance of the object that this wrapper represents.

Type Parameters

TResult

The type of the return value.

Exceptions

InvalidCastException

The conversion is not supported - or - Instance does not implement the IConvertible interface.

FormatException

Instance is not in a format for T recognized by InvariantCulture.

OverflowException

Instance represents a number that is out of the range of T.

InstanceAs<TResult>(IFormatProvider)

Returns a value that is equivalent to the instance of the object that this wrapper represents.

public TResult InstanceAs<TResult>(IFormatProvider provider)

Parameters

provider IFormatProvider

An object that supplies culture-specific formatting information.

Returns

TResult

A value that is equivalent to the instance of the object that this wrapper represents.

Type Parameters

TResult

The type of the return value.

Exceptions

InvalidCastException

The conversion is not supported - or - Instance does not implement the IConvertible interface.

FormatException

Instance is not in a format for T recognized by provider.

OverflowException

Instance represents a number that is out of the range of T.