Class NullableAttribute
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
boolNullability flag for current column.
NullableAttribute(string, bool)
Creates attribute isntance.
public NullableAttribute(string configuration, bool isNullable)
Parameters
configuration
stringMapping schema configuration name. See LinqToDB.Configuration.
isNullable
boolNullability flag for current column.
Properties
CanBeNull
Gets or sets nullability flag for current column.
Default value: true
.
public bool CanBeNull { get; set; }
Property Value
Methods
GetObjectID()
Returns mapping attribute id, based on all attribute options.
public override string GetObjectID()