Hey,
This works:
projections.Add(Projections.Property(Member<MailOrder>.From(x => x.AssigneeCode).QualifiedPath), Member<MailOrderItem>.From(x => x.AssigneeCode).Path);
projections.Add(Projections.Property(Member<MailOrder>.From(x => x.AssigneeName).QualifiedPath), Member<MailOrderItem>.From(x => x.AssigneeName).Path);
projections.Add(Projections.Property(Member<MailOrder>.From(x => x.AssigneeType).QualifiedPath), Member<MailOrderItem>.From(x => x.AssigneeType).Path);
This does not off course
projections.Add(Projections.Property(Member<IMailOrderAssignee>.From(x => x.AssigneeCode).QualifiedPath), Member<MailOrderItem>.From(x => x.Code).Path);
projections.Add(Projections.Property(Member<IMailOrderAssignee>.From(x => x.AssigneeName).QualifiedPath), Member<MailOrderItem>.From(x => x.GetName()).Path);
projections.Add(Projections.Property(Member<IMailOrderAssignee>.From(x => x.AssigneeType).QualifiedPath), Member<MailOrderItem>.From(x => x.GetType()).Path);
This does not work because of two things:
- there is no persister for theinterface
- Methods are used in Property way.
I've searched a lot in the world of Nhiberante, but it seems to me that this is quite difficult.
The IMailOrderAssignee is an interface for two rootentity's (let's call them RootX and RootY). In the context of my MailOrders, it isn't important what root it is, as long as I have a reference to it + The Name and it's code and emailaddresses.
The IMailOrderAssignee is mapped with the any - tag in the mapping file. (that works brilliant, but I could do it with an discriminator also).
My question:
Is it possible to use the result of a method in a projection query so the result is in the DTO?
Is it possible to uses contracts in projection querys (I guess not...)