Table of Contents

Enum ArrayNullabilityMode

Namespace
Npgsql
Assembly
Npgsql.dll

Specifies how the mapping of arrays of value types behaves with respect to nullability when they are requested via an API returning an object.

public enum ArrayNullabilityMode

Fields

Always = 1

Arrays of value types are always returned as nullable arrays (e.g. int?[]).

Never = 0

Arrays of value types are always returned as non-nullable arrays (e.g. int[]). If the PostgreSQL array contains a NULL value, an exception is thrown. This is the default mode.

PerInstance = 2

The type of array that gets returned is determined at runtime. Arrays of value types are returned as non-nullable arrays (e.g. int[]) if the actual instance that gets returned doesn't contain null values and as nullable arrays (e.g. int?[]) if it does.