IMapper interface implementation

In the past, I used PetaPoco, decorating my objects with attributes [Column("{column name")]and so on. However, I am trying to implement a β€œpure” domain model that does not know constancy and therefore does not know the attributes of PetaPoco.

The PetaPoco blog mentions that there is an interface IMapper("New Mapper API") that must be implemented to display objects in their tables without decorating the object class. However, neither the blog post nor the source code actually explains what the implementation should do IMapper.

If I just want to map my domain entities to the specific names of tables, primary keys and columns, do I need to implement IMapperand how can I do this?

+5
source share
1 answer

There is more recent information on cartographers here . In fact, you have a choice: write a class that implements IMapper, or create a descendant ConventionMapper(which already implements IMapperand which offers more detailed hooks for customization). You can write one mapper for each type or one mapper for an assembly.

ConventionMapper , ( ); , InflectColumnName() InflectTableName() . , , , IMO, IMapper ( StandardMapper) .

0

All Articles