Class InheritanceMappingAttribute
Defines to which type linq2db should map record based on discriminator value. You can apply this attribute to a base class or insterface, implemented by all child classes. Don't forget to define discriminator value storage column using IsDiscriminator.
Namespace: LinqToDB.Mapping
Assembly: linq2db.dll
Syntax
public class InheritanceMappingAttribute : MappingAttribute
Remarks
You cannot configure inheritance mapping using this attribute for discriminator types, not supported by .NET attributes. See document for a list of supported types.
Properties
| Improve this Doc View SourceCode
Gets or sets discriminator value.
Declaration
public object? Code { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Object> |
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> |
IsDefault
Get or sets flag, that tells linq2db that current mapping should be used by default if suitable mapping type not found.
Declaration
public bool IsDefault { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Type
Gets or sets type, to which record with current discriminator value should be mapped.
Declaration
public Type Type { get; set; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Improve this Doc View SourceGetObjectID()
Declaration
public override string GetObjectID()
Returns
Type | Description |
---|---|
System.String |