Hi Dan

Sorry for the slow delay but I've been answering you by mobile phone as I've
been away from my pc most of the weekend. Does anything need changing to
make AutoMapper work for you in your situation.

Cheers

Andy

On Mon, Aug 25, 2008 at 8:53 AM, Andrew Stewart <
[EMAIL PROTECTED]> wrote:

> you certainly can. Just use the maptypesderivedfrom for the order
> class and just map line items only.
>
> I'd give you an example but i'm typing this on my phone.
>
> Hope that makes sense.
>
> Andy
>
> On 8/25/08, Dan Blake <[EMAIL PROTECTED]> wrote:
> >
> > I think I have figured out what was going on.  The fluent nhibernate
> > code is fine.  It was my code.  I was trying to add a map for an
> > interface (which the mapper specifically filters out).
> >
> > In my domain objects I use interfaces to other domain object for
> > associations.  This isn't a problem using a mapping class, I just map
> > the concrete class to the interface for nHibernate purposes.
> >
> > Here is the equivalent, using a mapping class, of what I was trying to
> > do with the AutoMap functionality.
> >
> >  public class PurchaseOrder : IPurchaseOrder
> >     {
> >         private IList<IPurchaseOrderLine> _lines;
> >
> >          . . .
> >
> >         #region IPurchaseOrder Members
> >
> >         public long Id { get; set; }
> >         public DateTime DateCreated { get; set; }
> >         public string Vendor { get; set; }
> >
> >         public IList<IPurchaseOrderLine> Lines
> >         {
> >             get { . . . }
> >             private set { _lines = value; }
> >         }
> >         #endregion
> >     }
> >
> >     public class PurchaseOrderMap : ClassMap<PurchaseOrder>,
> > IMapGenerator
> >     {
> >         public PurchaseOrderMap()
> >         {
> >             Id(x => x.Id);
> >             Map(x => x.Vendor);
> >             HasMany<PurchaseOrderLine>(x => x.Lines)
> >             .AsList().Cascade.All();
> >         }
> >
> >
> > How might I be able to do this.  Is it possible to override the type
> > for the mapping for the Lines property either before or after the map
> > is created?
> >
> > Thanks,
> >
> > Dan Blake
> > On Aug 22, 5:18 pm, "Andrew Stewart" <[EMAIL PROTECTED]>
> > wrote:
> >> hi
> >>
> >> Looks like you've bumped into a bug. I'm guessing the dictionary that
> >> holds the mappings is getting emptied.
> >>
> >> I'll try to fix this over the weekend.
> >>
> >> Andy
> >>
> >> On 8/22/08, Dan Blake <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> > I have been changing some of my code to use that AutoMap feature.  It
> >> > works great, and I have been able to eliminate 35+ mapping classes.
> >>
> >> > One question I did have was how to use AutoPersistenceModel to map the
> >> > classes in more than one assembly.  I have tried various combinations
> >> > AddEntityAssembly, MapEntitiesFromAssemblyOf, etc..
> >>
> >> > No matter what I do, the mappings from the second assembly replace the
> >> > ones from the first assembly.
> >>
> >> > I am obviously missing something.  Can someone point me in the
> >> > direction of the best way to do this?
> >>
> >> > Thanks,
> >>
> >> > Dan Blake
> >>
> >> --
> >> =================
> >> I-nnovate Software - Bespoke Software Development, uk
> >> wirral.http://www.i-nnovate.net- Hide quoted text -
> >>
> >> - Show quoted text -
> > > >
> >
>
>
> --
>  =================
> 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