Hi,
I am playing with mapping by code and am wondering about conventions.
All of my mapping files share the same common functionality:-
1. All table names are lowercase:-
Table("organisationincometype");
2. All Bags have:-
bag.Cascade(Cascade.All | Cascade.DeleteOrphans)
and
bag.BatchSize(10)
and
action => action.OneToMany()
So my question is, is this possible to do via conventions? If so how as I
have seen a couple of posts by Fabio but cannot fathom this out.
My code to configure and build session factory is:-
var mapper = new ModelMapper();
mapper.AddMappings(typeof(Organisation).Assembly.GetTypes());
var configure = new Configuration();
configure.DataBaseIntegration(x =>
{
x.Dialect<MySQL5Dialect>();
x.ConnectionStringName = "db";
}).CurrentSessionContext<WebSessionContext>();
var mapping = mapper.CompileMappingForAllExplicitlyAddedEntities();
configure.AddDeserializedMapping(mapping, "Domain");
SessionFactory = configure.BuildSessionFactory();
Thanks
Rippo
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.