NHibernate3.0 Cookbook page 24-27
On Wed, Feb 2, 2011 at 1:16 PM, Giulio Petrucci
<[email protected]>wrote:
> Hello everybody,
>
> here is my class hierarchy:
>
> class A { ...}
> class X : A { }
> class Y : A { }
>
> class Foo
> {
> Int32 Id { get; }
> A MyAProperty { get; }
> }
>
> when I try to do the following:
>
> ISession session = ...;
> var foo = sessio.Get<Foo>(23);
> if (foo.MyAProperty is A)
> ...
>
> the IF condition evaluate always to 'false' as the property value's
> type is a proxy for 'A'.
> Could you suggest me any workaround? The first thing that came to my mind
> is:
>
> if (foo.MyAProperty as A != null)
> ...
>
> Any suggestion?
>
> Grazie,
> Giulio
>
>
> --
>
> --
> 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.
>
>
--
Fabio Maulo
--
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.