Doing your own Primary keys
Hans Karlsen (talk | contribs) No edit summary |
Hans Karlsen (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
[[File:2019-06-18 16h00 03.png|none|thumb|473x473px]]In Code you can go like this: | [[File:2019-06-18 16h00 03.png|none|thumb|473x473px]]In Code you can go like this: | ||
else if (rbPMappMDrivenServer.Checked) | |||
{ | |||
if (_ORMappingForMDrivenServer == null) | |||
{ | |||
_ORMappingForMDrivenServer = new Eco.Persistence.ORMapping.DefaultORMappingBuilder(); | |||
_ORMappingForMDrivenServer.ChildMapRootClass = true; | |||
_ORMappingForMDrivenServer.DefaultSingleLinkColumnName = "<Name>ID"; | |||
_ORMappingForMDrivenServer.IdColumnName = "<TableName>ID"; | |||
} | |||
persistenceMapperSqlServer1.RunTimeMappingProvider = _ORMappingForMDrivenServer; | |||
persistenceMapperSqlServer1.NewMappingProvider = _ORMappingForMDrivenServer; | |||
} |
Revision as of 15:44, 18 June 2019
MDriven legacy is to give the name Eco_Id to primary keys. New MDrivenSystems use <Classname>Id to make the database easier to read.
You can choose the default strategy freely if you are using MDriven Framework in Visual Studio.
In the Play-button-prototyper you can choose from legacy or MDriven:
In Code you can go like this:
else if (rbPMappMDrivenServer.Checked) { if (_ORMappingForMDrivenServer == null) { _ORMappingForMDrivenServer = new Eco.Persistence.ORMapping.DefaultORMappingBuilder(); _ORMappingForMDrivenServer.ChildMapRootClass = true; _ORMappingForMDrivenServer.DefaultSingleLinkColumnName = "<Name>ID"; _ORMappingForMDrivenServer.IdColumnName = "<TableName>ID"; } persistenceMapperSqlServer1.RunTimeMappingProvider = _ORMappingForMDrivenServer; persistenceMapperSqlServer1.NewMappingProvider = _ORMappingForMDrivenServer; }
This page was edited more than 1 years ago on 01/11/2024. What links here