Defines relation between tables or views. Could be applied to:
- instance properties and fields;
- instance and static methods.
For associations, defined using static methods,
this mapping side defined by type of first parameter.
Also, optionally, you can pass data context object as extra method parameter.
Based on association type - to one or to multiple records - result type should be target record's mapping type or
By default associations are used only for joins generation in LINQ queries and will have
null value for loaded
records. To load data into association, you should explicitly specify it in your query using
Stores association descriptor.
Specifies that current field or property is just an alias to another property or field. Currently this attribute has several issues:
- you can apply it to class or interface - such attribute will be ignored by linq2db;
- it is possible to define attribute without setting MemberName value;
- you can define alias to another alias property or field and potentially create loop.
Configures mapping of mapping class member to database column. Could be applied directly to a property or field or to mapping class/interface. In latter case you should specify member name using MemberName property.
Stores mapping entity column descriptor.
Configure setter and getter methods for dynamic columns.
Represents a dynamic column, which doesn't have a backing field in it's declaring type.
Marks target member as dynamic columns store.
Stores mapping entity descriptor.
Fluent mapping entity builder.
Fluent mapping builder.
Marks target column as identity column with value, generated on database side during insert operations. Identity columns will be ignored for insert and update operations with implicit column list like Insert<T>(IDataContext, T, Nullable<String>, Nullable<String>, Nullable<String>, Nullable<String>, TableOptions) or Update<T>(IDataContext, T, Nullable<String>, Nullable<String>, Nullable<String>, Nullable<String>, TableOptions) methods.
Stores inheritance mapping information for single discriminator value.
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.
Locked mapping schema.
Stores enum mapping information for single enum value.
Defines bidirectional mapping between enum field value, used on client and database value, stored in database and used in queries. Enumeration field could have multiple MapValueAttribute attributes.
Mapping from database value to enumeration performed when you load data from database. Linq2db will search for
enumeration field with MapValueAttribute with required value. If attribute with such value is not
found, you will receive LinqToDBException error. If you cannot specify all possible values using
MapValueAttribute, you can specify custom mapping using methods like
Mapping from enumeration value performed when you save it to database or use in query. If your enum field has multiple MapValueAttribute attributes, you should mark one of them as default using IsDefault property.
Marks current property or column to be ignored for mapping when explicit column mapping disabled. See IsColumnAttributeRequired.
Sets nullability flag for current column to
See NullableAttribute for more details.
Explicitly specifies that associated column could contain
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.
Marks property or field as a member of primary key for current mapping type.
Column or association fluent mapping builder.
Contains reference to filter function defined by
Used to mark the index of a result set when multiple result sets need to be processed for a command.
Overrides default scalar detection for target class or structure.
By default linq2db treats primitives and structs as scalar types.
This attribute allows you to mark class or struct as scalar type or mark struct as non-scalar type.
Also see IsStructIsScalarType.
Note that if you marks some type as scalar, you will need to define custom mapping logic between object of
that type and data parameter using
Specifies value generation sequence for mapped property of field. Currently it supported only for:
- Firebird generators
- Oracle sequences
- PostgreSQL serial pseudotypes/sequences
Abstract Attribute to be used for skipping values
Abstract Attribute to be used for skipping value for SkipValuesOnInsertAttribute based on Insert or SkipValuesOnUpdateAttribute based on Update/> or a custom Attribute derived from this to override ShouldSkip(Object, EntityDescriptor, ColumnDescriptor)
Attribute for skipping specific values on insert.
Attribute for skipping specific values on update.
Maps databse table or view to a class or interface. You can apply it to any class including non-public, nester or abstract classes. Applying it to interfaces will allow you to perform queries against target table, but you need to specify projection in your query explicitly, if you want to select data from such mapping.
Mapping entity column descriptor change interface.
Mapping entity descriptor change interface.
Flags for specifying skip modifications used for Attributes based on SkipBaseAttribute.