Table of Contents

Class NullableAttribute

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll

Explicitly specifies that associated column could contain NULL values. Overrides default nullability flag from current mapping schema for property/field type. Has lower priority over CanBeNull. Using this attribute, you can allow NULL values for identity columns.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true)]
public class NullableAttribute : MappingAttribute, _Attribute
Inheritance
NullableAttribute
Implements
Derived
Inherited Members
Extension Methods

Constructors

NullableAttribute()

Creates attribute isntance.

public NullableAttribute()

NullableAttribute(bool)

Creates attribute isntance.

public NullableAttribute(bool isNullable)

Parameters

isNullable bool

Nullability flag for current column.

NullableAttribute(string, bool)

Creates attribute isntance.

public NullableAttribute(string configuration, bool isNullable)

Parameters

configuration string

Mapping schema configuration name. See LinqToDB.Configuration.

isNullable bool

Nullability flag for current column.

Properties

CanBeNull

Gets or sets nullability flag for current column. Default value: true.

public bool CanBeNull { get; set; }

Property Value

bool

Methods

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string