The use of the "new" keyword is usually an indicator of bad design (you have
two elements in the same hierarchy, with the same name but different
meanings). Plus, you are trying to add additional constraints on
inheritance.

   Diego


On Thu, Jan 28, 2010 at 16:33, roend <[email protected]> wrote:

> I have an inheritance structure that looks something like this:
>
> public class BaseClass
> {
>    public virtual IColllection<BaseClassCollection> Collection { get;
> set; }
> }
>
> public class ChildClass : BaseClass
> {
>    public new virtual ICollection<ChildClassCollection> Collection
> { get; set; }
> }
>
> Is there a way with a joined subclass mapping to make this work.
>
> There error I'm getting is:
>
> {"Unable to cast object of type
> 'NHibernate.Collection.Generic.PersistentGenericBag`1
> [BaseClassCollection]' to type
> 'System.Collections.Generic.ICollection`1[ChildClassCollection]'."}
>
> I get this error when I try to get a ChildClass instance from the
> database.
>
> Any ideas?
>
> Thanks,
> Nathan
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to