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.
Namespace: LinqToDB.Mapping
Assembly: linq2db.dll
Syntax
public class NullableAttribute : MappingAttribute
Constructors
| Improve this Doc View SourceNullableAttribute()
Creates attribute isntance.
Declaration
public NullableAttribute()
NullableAttribute(Boolean)
Creates attribute isntance.
Declaration
public NullableAttribute(bool isNullable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isNullable | Nullability flag for current column. |
NullableAttribute(String, Boolean)
Creates attribute isntance.
Declaration
public NullableAttribute(string configuration, bool isNullable)
Parameters
Type | Name | Description |
---|---|---|
System.String | configuration | Mapping schema configuration name. See Configuration. |
System.Boolean | isNullable | Nullability flag for current column. |
Properties
| Improve this Doc View SourceCanBeNull
Gets or sets nullability flag for current column.
Default value: true
.
Declaration
public bool CanBeNull { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Configuration
Gets or sets mapping schema configuration name, for which this attribute should be taken into account.
ProviderName for standard names.
Attributes with null
or empty string Configuration value applied to all configurations (if no attribute found for current configuration).
Declaration
public string? Configuration { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
Methods
| Improve this Doc View SourceGetObjectID()
Declaration
public override string GetObjectID()
Returns
Type | Description |
---|---|
System.String |