Defining a derive entity class
Posted: Mon 07 Feb 2011 14:10
I have the following structure in my db:
Order:
- OrderId
OrderPerson:
- OrderId
- PersonTypeId
PersonType:
- PersonTypeId
- Description ("Customer", "Requester", "Salesman",...)
I understand that I can add a new class/entity that inherits from OrderPerson and call that class/entity OrderCustomer, OrderRequester, OrderSalesman...
What I am struggling with is where/how to define the additional criteria:
PersonType.Description == "Customer"
I know I can do it at the query level, but I want to deifne it at the model level. I also want to eastablish the rule that an order is not recognized as an order until it has a Customer, Requester, and Salesman.
My environment is Oracle 11g, VS2010, EF4, Devart dotConnect for Oracle Professional and Devart OraDeveloper Tools.
Thanks,
Sammer
Order:
- OrderId
OrderPerson:
- OrderId
- PersonTypeId
PersonType:
- PersonTypeId
- Description ("Customer", "Requester", "Salesman",...)
I understand that I can add a new class/entity that inherits from OrderPerson and call that class/entity OrderCustomer, OrderRequester, OrderSalesman...
What I am struggling with is where/how to define the additional criteria:
PersonType.Description == "Customer"
I know I can do it at the query level, but I want to deifne it at the model level. I also want to eastablish the rule that an order is not recognized as an order until it has a Customer, Requester, and Salesman.
My environment is Oracle 11g, VS2010, EF4, Devart dotConnect for Oracle Professional and Devart OraDeveloper Tools.
Thanks,
Sammer