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 = 1Arrays of value types are always returned as nullable arrays (e.g.
int?[]).Never = 0Arrays 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 = 2The 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.When using this setting, make sure that your code is prepared to the fact that the actual type of array instances returned from APIs like GetValue(int) may change on a row by row base.