Mapping By code: Handling all with custom ModelInspector
19 views
Skip to first unread message
FaticaLabs
unread,
Sep 1, 2011, 5:59:42 AM9/1/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Hi all,
I have a scenario in which I suppose I can handle the whole mapping by
conventions. So a custom model inspector plus the model mapper events
should allow me to do all the job. I eventually end with having all
empty ClassMapping<T> for each entity in the model, just to being able
to feed the ModelMapper, that accepts just classes implementing
IConformistHolderProvider. Is there some way to tell ModelMapper to
map a suite of entity directly ? My model inspector would care about
specifyng properies, id's and so on.
Thanks !
FaticaLabs
unread,
Sep 1, 2011, 6:58:14 AM9/1/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Well I found myself:
I was using
mapper.CompileMappingForAllExplicitlyAddedEntities();
I can achieve what i need by using
mapper.CompileMappingFor(...)
and passing the needed types.
Fabio Maulo
unread,
Sep 1, 2011, 11:50:02 AM9/1/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message