Issue with derived class
-
6. března 2012 8:30
Dear Allen,
I am facing one new issue. Here I have created a derived class "PersonGuarantorPerson" from base "TransactionMemberPerson". However when I try retrieve records from "TransactionMemberPerson" base class all records type of fetched records are of type "PersonGuarantorPerson" class. Can you suggest me the reason for this issue.
Sample code
https://skydrive.live.com/redir.aspx?cid=16ea07f5df7ddce7&resid=16EA07F5DF7DDCE7!189&parid=16EA07F5DF7DDCE7!186
Thanks and best regards,
Vipul
Všechny reakce
-
7. března 2012 5:59Moderátor
Hi Vipul,
Welcome to MSDN Forum.
Glad to see you again! Because the 'PersonGuarantorPerson' is derived from 'TransactionMemberPerson', so a 'PersonGuarantorPerson' object is also a 'TransactionMemberPerson' object. When you query the TransactionMemberPerson out, you will query all the objects which type is 'TransactionMemberPerson' out. You can try to create another entity to derived from the 'TransactionMemberPerson' type, then insert some records of this type to the database, query out the 'TransactionMemberPerson' type objects again, you will find the total number is the two types of records sum.
Best Regards
Allen Li [MSFT]
MSDN Community Support | Feedback to us
- Upravený Allen Li - AI3Microsoft Contingent Staff, Moderator 7. března 2012 6:32
- Označen jako odpověď Allen Li - AI3Microsoft Contingent Staff, Moderator 12. března 2012 1:59