Table of Contents

Method As

Namespace
LMKit.Extraction
Assembly
LM-Kit.NET.dll

As<T>(T)

Strongly typed projection of Value. Returns defaultValue if cast/conversion fails.

public T As<T>(T defaultValue = default)

Parameters

defaultValue T

Fallback value if the cast or conversion fails. Default is default(T).

Returns

T

Value converted to T, or defaultValue.

Type Parameters

T

Target type for conversion.

Examples

var price = resultElement.As<decimal>(0m);
Console.WriteLine(price);