EntityPropMappings.tt
EntityPropMappings.Dict is attached into the constructor when creating D3Context.
1. Update the input arguments
PropKeyRegex = new Regex(@"[A-Za-z_][A-Za-z0-9_]+Id$");
PropIdFormat = "{0}Id";
DbIdFormat = "{0}_id";
NameSpaceStr = "KLO128.D3ORM.Sample.Infra.D3ORM.MySQL";
EntitiesNameSpace = "KLO128.D3ORM.Sample.Domain.Models.Entities";
var sourceProjectFile = Host.ResolvePath("../KLO128.D3ORM.Sample.Domain/IQueryContainer.cs"); //any root file
- PropKeyRegex is a regular expression used for recognition of id properties.
- PropIdFormat is the id property name format.
- DbIdFormat is the id column name format.
- NameSpaceStr is the namespace of the generated (target) class.
- EntitiesNameSpace is the namespace of entities.
- sourceProjectFile is the path of some root project file, where the entities are located in.
2. Run the text template
Run the text template to generate the core entity navigation and the core mappings between application and database names.