Table of Contents

Enum NullAction

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

What a NullPolicyAttribute does when a member's column is NULL.

public enum NullAction

Fields

None = 0

No check: the member's type is trusted, at hand-written speed.

The same as no policy. On a member it overrides the type's policy, so one hot member can opt out. A NULL into a nullable member is null; into a non-nullable one it surfaces as the provider's own exception inside a ValueMappingException that names the model type and the row (the member and the column are not known). To find which member and column, use Throw.

Throw = 1

Checks the member, and a NULL throws ValueMappingException naming the member, the column and the 0-based row.

The value is not read. It costs one NULL test per covered member per row. Use it to track a NULL down, or to require a value from a nullable member.

Default = 2

Checks the member, and a NULL leaves it as it is: its initializer, else default.

A constructor parameter receives its declared default value, else default. It costs one NULL test per covered member per row. For a value of your choosing, use NullValueAttribute.

Remarks

None adds no check. Throw and Default test each member they cover for NULL before its value is read: one NULL test per covered member per row.

See Also