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
I am not sure whether I have asked a stupid question, an unanswerable question or nobody has picked up on this yet...
Can anyone offer any guidance?
Many thanks
------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
http://fabiomaulo.blogspot.com/2011/04/nhibernate-32-mapping-by-code.html
You should do this with the mapper before building the mappings.
2011/7/13, Richard Wilde <ric...@wildesoft.net>:
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to nhu...@googlegroups.com.
> To unsubscribe from this group, send email to
> nhusers+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
--
Enviado desde mi dispositivo móvil
Join to write a blog-post with this and others matters.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/rafuOwshwJYJ.