none
Issue with derived class RRS feed

  • Question

  • 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

    Tuesday, March 6, 2012 8:30 AM

Answers

  • 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


    Wednesday, March 7, 2012 5:59 AM
    Moderator