4

I'm automapping most of my model, but have a problem with generics. I've got ValueContainer<TValue>, and I make it abstract so that it doesn't throw an exception during automapping. Next, I have to create classes like StringValueContainer just to make it mapped. Needless to say, I don't like this approach, since I'm perfectly happy with the generic classes.

So, the question is, how do I manually map classes like ValueContainer<string> that inherit from an automapped class? I tried to fluently configure the subclass via SubclassMap, but that, predictably, failed.

Just to clarify: I've got StringValueContainer: ValueContainer<string>, but the StringValueContainer class doesn't add any value except for automapping, so I'm wondering if it's possible to do it in a cleaner way.

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
ulu
  • 5,872
  • 4
  • 42
  • 51

0 Answers0