Hi guys,
I use *NHibernate 3.3.1.4000* See the following code:
var mapper = new ConventionModelMapper();
mapper.IsVersion((m, d) => m.Name == "Version");
mapper.Class<Campaign>(x =>
{
x.Id(c => c.Id, m => m.Generator(Generators.Assigned));
x.Property(c => c.Title);
x.Property(c => c.Price);
});
config.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
With this configuration. The Campaign.Version will not worked as a Version
property. The value will never increased.
But if I use explicit mapping like this:
var mapper = new ConventionModelMapper();
mapper.Class<Campaign>(x =>
{
x.Id(c => c.Id, m => m.Generator(Generators.Assigned));
x.Property(c => c.Title);
x.Property(c => c.Price);
x.Version(c => c.Version, m =>
m.Generated(VersionGeneration.Never));
});
config.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
It works!! But *why the ConventionModelMapper doesn't work? How can I get
the convention mapper work? *Thanks
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.