Alexander Kot
unread,Aug 15, 2011, 9:28:06 AM8/15/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhu...@googlegroups.com
Hello all
I am playing with mapping by code convention in 3.2
I would like to implement next:
If there is int Ver {...} property in class use it for versioning.
I do next:
ConventionModelMapper m_mapper = new ConventionModelMapper();
........
m_mapper.BeforeMapClass +=
(mi, t, map) =>
{
map.Id( .....);
map.Version(t.GetProperty("Ver") , vmap => vmap.Column("VER"));
};
That is not enough
when i do OpenSession there is exception
"Duplicate property mapping of Ver found in WindowsFormsApplication3.MyEntity......."
So despite map.Version(...) call, Ver property is mapped also as simple property by core ( i see it in call to m_mapper.BeforeMapProperty )
If add
m_mapper.IsPersistentProperty((m, declared) => (m.Name != "Ver"));
All will work fine
Is that bug or feature?