In This Topic
Conventions serve to automatically configure mapping according to the specified rules. This allows you not to define the whole model mapping explicitly, you may skip some parts of mapping, and it will be generated with default values.
Default conventions:
- BinaryPropertyConvention
- CreateAssociationConvention
- CreateComplexTypeConvention
- CreateTPTInheritanceConvention
- DateTimePropertyConvention
- NumberPropertyConvention
- PrimaryKeyConvention
- PropertyNameConvention
- PropertyOrderConvention
- TableNameConvention
- StorageConvention
- StringPropertyConvention
- UpdateCheckConvention
User conventions must implement one of the following interfaces:
- IEntityConvention - for modifying entity configurations
- IComplexConvention - for modifying complex type configurations
- IPropertyConvention - for modifying property configurations
Some default conventions implement the IStrategyConvention interface. Such conventions don't do anything themselves but affect fluent mapping generation.
All the default conventions can be disabled, enabled again, or reconfigured through their public properties.
Conventions interact with configurations through their interfaces:
- IEntityConfiguration
- IComplexConfiguration
- IPropertyConfiguration
- IInheritanceConfiguration - for TPH inheritances
- IAssociationConfiguration
- IModelConfiguration - interface to the whole mapped model. Allows access to all configurations and ignore lists.