MJCZone.DapperMatic.DataAnnotations
Assembly: MJCZone.DapperMatic
Classes
| Name | Description |
|---|---|
| DmCheckConstraintAttribute | Attribute to define a check constraint. |
| DmColumnAttribute | Attribute to define a database column. |
| DmConcurrencyTokenAttribute | Marks the property that changes on every write, so that a row written by key is written only if no one else has written it since it was read: an <c>int</c> or <c>long</c> (incremented), a <c>Guid</c> (new on each write), or a <c>byte[]</c> (new random bytes, or on SQL Server a <c>rowversion</c> column the database writes). A row that changed throws <c>DmConcurrencyException</c>. |
| DmCreatedAtAttribute | Marks the property the DML methods set to the time a row is inserted, from <c>DmDefaults.Clock</c>, in UTC: a <c>DateTime</c> or a <c>DateTimeOffset</c>. Updates never change it. |
| DmCreatedByAttribute | Marks the property the DML methods set to the user who inserts a row, from the scope's <c>WithUser</c> or <c>DmDefaults.User</c>, converted to the property's type. Updates never change it, and it is left as it is when there is no user. |
| DmDefaultConstraintAttribute | Attribute to define a default constraint on a property. |
| DmForeignKeyConstraintAttribute | Attribute to define foreign key constraints on a class or property. |
| DmIgnoreAttribute | Attribute to ignore a property in the mapping. |
| DmIndexAttribute | Attribute to define a database index. |
| DmPrimaryKeyConstraintAttribute | Attribute to define a primary key constraint on a table. |
| DmRelationAttribute | Marks a property as a relation to another model's rows, never a column: one related row (<c>public Customer? Customer</c>) or many (<c>public List<OrderLine>? Lines</c>). Relations are filled only when a query asks (<c>Include</c>), and can be filtered on (<c>o => o.Lines!.Any(l => ...)</c>). |
| DmSoftDeleteAttribute | Marks the property that says a row is deleted: a <c>bool</c> (true when deleted) or a nullable <c>DateTime</c> or <c>DateTimeOffset</c> (when it was deleted). The DML methods' deletes then set it instead of removing the row, and every read leaves deleted rows out unless the query says <c>IncludeDeleted()</c> or <c>OnlyDeleted()</c>; <c>HardDeleteAsync</c> removes rows. |
| DmTableAttribute | Attribute to define the table name and schema for a class. |
| DmTenantKeyAttribute | Marks the property that says which tenant a row belongs to. Every DML method then reads and writes only the scope's tenant's rows (<c>ForTenant(id)</c>, or <c>DmDefaults.TenantId</c>), and sets it on inserted rows; with no tenant, the methods refuse the model, unless the scope says <c>AllTenants()</c>. |
| DmUniqueConstraintAttribute | Attribute to define a unique constraint on a table. |
| DmUpdatedAtAttribute | Marks the property the DML methods set to the time a row is inserted or updated, from <c>DmDefaults.Clock</c>, in UTC: a <c>DateTime</c> or a <c>DateTimeOffset</c>. |
| DmUpdatedByAttribute | Marks the property the DML methods set to the user who inserts or updates a row, from the scope's <c>WithUser</c> or <c>DmDefaults.User</c>, converted to the property's type; left as it is when there is no user. |
| DmViewAttribute | Attribute to define a database view. |