Doing your own Primary keys
No edit summary
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:


here
      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:

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