locked
Association in EF RRS feed

  • Question

  • I have tables definition as follows a. Expense Table (Abstract Class) b. Expense From Cash (Inherit Expense) c. Expense From Credit Card (Inherit Expense) with additional column of IdCardXact d. Expense From Account (Inherit Expense) with additional column of IdAcctXact e. Card Transaction with columns of IdCardXact, Card Date, Source, IdSource (where Source could be E = Expense, A = Account and IdSource = IdExpense if Source = E else IdAcctXact if Source = A)

    The question is how do I break down Credit Card into entity of Card Transaction into Card Transaction From Expense and Card Transaction from Account.

    I have tried to define but no clue to add record to this entity structure.

    Any help would be much appreciated.

    Wednesday, December 12, 2012 1:34 AM

All replies

  • Hi Raymond,

    Welcome to the MSDN forum.

    I am not clear about your question. Do you mean you do not want to Card Transaction table inherit from Credit Card table and Account table but it must have IdAcctXact and IdCardXact fields?

    The Card Transaction table has the ambiguous fields: Source, IdSource. If you want to map this class to database which is not possible I think.

    Have a nice day.


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 13, 2012 6:44 AM
  • I know I can break the Card Transaction into Entity of Card Transaction From Account and Card Transaction From Expense. However, whenever I link up tables Card Transaction From Expense with Expense From Credit Card which is 1-1, I do not know how to insert data.

    Can u advice me?

    Thursday, December 13, 2012 8:09 PM
  • Hi Raymond,

    Could you please show us the table schema of Card Transaction From Expense and Expense From Credit Card? 

    Best Regards,


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, December 16, 2012 12:50 PM