Hi
I'm just looking over our convention logic. What I'd like to be able to do
is specify that certain things happen in all my maps, at the moment I have
the following working:

AutoPersistenceModel
   .MapEntitiesFromAssemblyOf<Company>()
   .Where(  t => (t.Namespace.Contains("NamespaceName")
   .ForTypesThatDeriveFrom<Task>( map => map.HasManyToMany<User>( t =>
t.Users ) )
   .ForTypesThatDeriveFrom<Plot>( map => map.HasManyToMany<Service>( t =>
t.Services ) )
   .WithConvention( c => c.OneToManyConvention = m =>
                                                                  {

 m.SetAttribute("cascade", "all");

 m.SetAttribute("lazy", "true");
                                                                  })
   .Configure( configuration );

As you can see the bit in bold isn't nice at all. But it does work. What I'd
like to achieve and I'm sure the syntax could be improved slightly is
something more like the below:

AutoPersistenceModel
   .MapEntitiesFromAssemblyOf<Company>()
   .Where(  t => (t.Namespace.Contains("NamespaceName")
   .ForTypesThatDeriveFrom<Task>( map => map.HasManyToMany<User>( t =>
t.Users ) )
   .ForTypesThatDeriveFrom<Plot>( map => map.HasManyToMany<Service>( t =>
t.Services ) )
   .WithConvention( c => c.OneToManyConvention = m =>
                                                                  {

 m.Cascade.All();

 m.LazyLoad();
                                                                  })
   .Configure( configuration );

Now here's my problem at the moment Generic Types.

Essentially the OneToMany is generic and I want to apply these to all
different types of entity maps, has anyone got a good idea on how to make
these none generic-able?

Maybe someone has some preset idea's on how this should be implemented who
can just overirde this entire conversation, and I'll just head down that
route instead.

Cheers

Andy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to