henkmollema / Dapper-FluentMap

Provides a simple API to fluently map POCO properties to database columns when using Dapper.
MIT License
429 stars 88 forks source link

How to handle multiple mappings to same model? #113

Closed bokmadsen closed 4 years ago

bokmadsen commented 4 years ago

Can Dapper-FluentMap handle mutiple mappings to same model? I have a model I use for 2-3 different requests, and I can't garantie same column names each time: Request1 (col1, col2, col3) -> Model (prop1, prop2, prop3) Request2 (col2, col3, col3) -> Model (prop1, prop2, prop3)

From what I can read, this won't be possible, because the EntityMapper only takes the destination (Model) as type.

I there a way to work around this?

henkmollema commented 4 years ago

Unfortunately this is not supported. You'll have to create distinct models.