Table of Contents

Struct SingleOrDefault<T>

Namespace
Rinku
Assembly
Rinku.dll

Reads zero or one reference result. No result gives an empty value and a second result throws. A present NULL still throws.

public readonly struct SingleOrDefault<T> : IWrapping<SingleOrDefault<T>, T> where T : class

Type Parameters

T
Implements
Inherited Members
Extension Methods

Constructors

SingleOrDefault(T)

Reads zero or one reference result. No result gives an empty value and a second result throws. A present NULL still throws.

public SingleOrDefault(T value)

Parameters

value T

Fields

Value

The value, or null when there was no row.

[MaybeNull]
public readonly T? Value

Field Value

T

Properties

HasValue

Whether a row was read.

public bool HasValue { get; }

Property Value

bool

Methods

Make(T)

Creates the wrapper from a value returned by a query.

public static SingleOrDefault<T> Make(T val)

Parameters

val T

Returns

SingleOrDefault<T>

Operators

implicit operator T?(SingleOrDefault<T>)

public static implicit operator T?(SingleOrDefault<T> val)

Parameters

val SingleOrDefault<T>

Returns

T

implicit operator SingleOrDefault<T>(T?)

public static implicit operator SingleOrDefault<T>(T? val)

Parameters

val T

Returns

SingleOrDefault<T>