Can automapper handle private readonly backing fields?
I like private readonly backing fields because some objects are mostly read-only after creation, and for collections, which should
almost never be set wholesale (seems like, since there are add and
remove item methods). But as far as I remember fluent-nhibernate's
automapper never had a solution for private readonly backing fields,
I'm wondering if that's changed in the last few months. So here's my
question:
How do I configure automapper or create an automapping convention to
map private readonly backing fields?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by m4bwav on 12 Apr, 2010 03:52 PM
Answer found.
There is no support for readonly backing fields in the fluent nhibernate auto-mapper
Support Staff 3 Posted by James Gregory on 16 May, 2010 05:42 PM
This is now supported in the latest version. By default it'll map them as nosetter.camelcase or backfield depending on whether they're an autoproperty. Failing that, you can also override the
ShouldMap(Member)
method in yourIAutomappingConfiguration
to explicitly map those members.4 Posted by m4bwav on 19 May, 2010 02:14 PM
Hey, thanks a lot! Your the man!
James Gregory closed this discussion on 19 May, 2010 02:21 PM.