Hi Paul
And now the second one applied.

Very Good Work!

Andy

On Tue, Sep 16, 2008 at 2:07 PM, Paul Batum <[EMAIL PROTECTED]> wrote:

>
> I love problems like this. Keep 'em coming :D
>
> On Tue, Sep 16, 2008 at 2:04 PM, Andrew Stewart
> <[EMAIL PROTECTED]> wrote:
> > Cheers Paul
> > You are a star, once I get my laptop back up and running I'll go about
> > applying your first patch, and I'll look into this second patch.
> > Thanks
> > Andy
> > On Tue, Sep 16, 2008 at 1:38 PM, Paul Batum <[EMAIL PROTECTED]>
> wrote:
> >>
> >> Hi Andy,
> >>
> >> This one was pretty straightforward to fix using interfaces. I created
> >> an IOneToManyPart interface with Cascade, LazyLoad, and Inverse. I
> >> then implemented it explicitly on OneToManyPart delegating where I
> >> could to the existing implementation. I then modified the
> >> AlterOneToManyMap method on Conventions to accept an IOneToManyPart
> >> interface and modified the delegate it calls accordingly. You should
> >> now find the 'm' parameter In the original code you supplied is a
> >> IOneToManyPart and your desired code will compile.
> >>
> >> As with your last problem, I've attached the changes in patch format
> >> so you can see whats different and figure out where you want to go
> >> next.
> >>
> >> Paul Batum
> >>
> >> On Fri, Sep 12, 2008 at 11:54 AM, Andrew Stewart
> >> <[EMAIL PROTECTED]> wrote:
> >> > Hi James
> >> > If you take this out of the automapping loop, the same applies for
> >> > individual mappings. Lets say I want lazy loading on in all my maps
> but
> >> > don't want to specify that over and over again. You can specify it in
> >> > the
> >> > Visitor.Conventions. and it will apply it when you write your
> individual
> >> > mappings. So for example:
> >> >             var model = new PersistenceModel();
> >> >             model.Conventions.OneToManyConvention = o =>
> >> > o.SetAttribute("lazy", "true");
> >> >             model.addMappingsFromAssembly("Load Assembly Here");
> >> >             model.Configure(cfg);
> >> > That will work at the moment. Automap just sits on top of the normal
> >> > code.
> >> > To better phrase my question, I was just wondering if anyone had any
> >> > idea's
> >> > on a good way to handle conventions, as at the moment I'm struggling.
> >> > Cheers
> >> > Andy
> >> >
> >> > On Fri, Sep 12, 2008 at 11:35 AM, James Gregory
> >> > <[EMAIL PROTECTED]>
> >> > wrote:
> >> >>
> >> >> Off the top of my head, I don't think we can de-generic those
> classes.
> >> >> We
> >> >> need the generic type definitions to create the Expression<T>
> >> >> parameters.
> >> >> I'm so out of the loop, but couldn't you have it where the onetomany
> >> >> convention gets registered into a list that all onetomany's use when
> >> >> writing
> >> >> their output, rather than just ones for that exact type?
> >> >> I need to spend some time getting my head around what you've been
> doing
> >> >> with this automapping/conventions stuff.
> >> >>
> >> >> On Fri, Sep 12, 2008 at 11:16 AM, Andrew Stewart
> >> >> <[EMAIL PROTECTED]> wrote:
> >> >>>
> >> >>> 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
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > =================
> >> > I-nnovate Software - Bespoke Software Development, uk wirral.
> >> > http://www.i-nnovate.net
> >> >
> >> > >
> >> >
> >>
> >>
> >
> >
> >
> > --
> > =================
> > I-nnovate Software - Bespoke Software Development, uk wirral.
> > http://www.i-nnovate.net
> >
> > >
> >
>
> >
>


-- 
=================
I-nnovate Software - Bespoke Software Development, uk wirral.
http://www.i-nnovate.net

--~--~---------~--~----~------------~-------~--~----~
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