There are a few approaches here: If you really need to work with the
two types off a parent in a separate way, you might consider having a
collection off the parent for each type (this may or may not makes
sense in your context).  Or if you're searching, you can separately
search for GoodCustomer and BadCustomer. Or, depending on what you're
doing you can move your differing code into GoodCustomer and
BadCustomer.

I think I'd avoid doing an approach that uses a typeof on a Customer
if possible, that's a path that will lead to more fragile code, and
can be a bit problematic with NHibernate's lazy loading/proxying.  If
you must do something of this sort, a similar, but less troublesome
approach is that you might want to abstract a "MyType" (pick your own
name) property off your abstract customer, and then have GoodCustomer
and BadCustomer report their own types-same sort of fragile code
issues, but avoids the proxy object issues.

On Fri, Jun 19, 2009 at 12:13 AM, jobsamuel<[email protected]> wrote:
>
> Suppose you do a query like "from Customer" it will give you both
> GoodCustomer and BadCustomer as you are querying the base class. You
> can check which one it is using the type of object.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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