http://ayende.com/blog/4168/answer-the-lazy-loaded-inheritance-many-to-one-association-or-m-conundrum
/Oskar 2013/3/19 Alexander Op De Weegh <[email protected]>: > Hi, > > I have the following structure of interfaces defined. > > public interface IInstruction {} > public interface ICheckInstruction : IInstruction {} > > Then, in another module (DLL), I have the following classes defined: > > [Class(Table = "instruction", NameType = typeof(Instruction), Lazy = true, > Abstract = true)] > public abstract Instruction : IInstruction > { > [List(...)] > [Key(...)] > [Index(...)] > [ManyToMany(...)] > public virtual IList<IInstruction> Childs { get; set; } > } > > [JoinedSubclass(0, Table = "checkinstruction", NameType = > typeof(CheckInstruction), ExtendsType = typeof(Instruction), Lazy = true)] > [Key(1, Column = "instructionid")] > public CheckInstruction : Instruction, ICheckInstruction {} > > Apart from the ICheckInstruction interface and CheckIntruction class there > are more decendants of IInstruction and Instruction respectivily. > > The problem is that I've an instruction loaded that contains a list of > childs (Childs property). One of the childs is a CheckInstruction. Or at > least, it should be. Unfortunately, the object is of type InstructionProxy. > So, it cannot be cast to ICheckInstruction. > > What could be the problem here? > > Any help is welcome, > > Thanks, > Alexander. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/nhusers?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
