Using a GUID as the key in ECO
- Drop a DefaultORMappingBuilder component next to your persistence mapper.
- Point PersistenceMapperxxxxx1.NewMappingProvider and RuntimeMappingProvider to point to this new component.
- On your PersistenceMapper component expand SqlDatabaseConfig and click the [...] next to KeyMappers, ensure that you have an item named "GuidMapper" with the MapperTypeName set to "Eco.Persistence.GuidKeyMapper". If not then add it.
- On your DefaultORMapperBuilder set IdKeySignature to System.Guid (case sensitive).
- Set its IdMapperName to GuidMapper.
Now regenerate your DB.
Comments