Doing your own Primary keys

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:

2019-06-18 16h00 03.png

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 114 days ago on 01/11/2024. What links here