Knight Data Access Layer uses a convention based approach to automatic mapping. Specifically:
- Class names are considered singular and table names default to plural. To override this set Mapper.PluralTableNames = false
- Primary Keys are mapped by searching for an ID property or ClassNameId property as an integer or long. In the table it defaults to TableNameId. To override this behavior, set the Mapper.DefaultPrimaryKeyName
- IsNew, IsDirty, and IsDeleted are special properties that are never saved to the database. See the corresponding topics for more information.
- CreateDate, CreateUser, UpdateDate, UpdateUser, MachineName are maintenance fields that will automatically be filled in during save. See the Maintenance Fields topic for more information.
- To verify the mapping see the Verify Mappings topic.
- Reflection info is automatically cached for the mapping.
- Relationships are automatically mapped including parent, child, and many to many relationships. If a class contains a list of objects it is considered as child records. If a class contains a reference to another class, it is considered a parent. This default behavior can be overridden with attributes, code, or XML files. See the Mapping Relationships topic for more information.
- Foreign key constrains and indexes are added automatically for parent tables.