Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9139509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:23:49+00:00 2026-06-17T09:23:49+00:00

First the error I have: All objects in the EntitySet ‘Z10Entities.Accounts’ must have unique

  • 0

First the error I have:

All objects in the EntitySet ‘Z10Entities.Accounts’ must have unique
primary keys. However, an instance of type
‘DAL.Model.CreditCardAccount’ and an instance of type ‘DAL.Model.Debt’
both have the same primary key value, ‘EntitySet=Accounts;Id=3’.

Here is my schema:
Schema using Table Per Type Inheritance

From my design view point the account can be of both a creditcard type and considered a debt. Have I done something wrong or am I running into a limitation of the EF framework (4.3.1 version)

EDIT: To add some clarity to my question is basically I am trying to understand why the framework is giving me the error or if the dynamic data foreign key FieldTemplate is not working correctly.

EDIT 2: It seems this problem has affected other parts of my application. Seems like I have a TPT problem:

All objects in the EntitySet ‘Z10Entities.Person’ must have unique
primary keys. However, an instance of type ‘DAL.Model.Employer’ and an
instance of type ‘DAL.Model.PortalUser’ both have the same primary key
value, ‘EntitySet=Person;Id=1b64b850-34f9-e111-bdc8-000c29005764’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:23:50+00:00Added an answer on June 17, 2026 at 9:23 am

    Well it seems that TPT is great for some things and not for others. Due to my business design I need to have varying accounts be accountable as debt (Accounts charged off, credit cards closed and so on.).

    TPT doesn’t handle this because of the PK to PK pattern. It must be FK to PK pointing at the base table. This subtle change facilitates the desired functionality while also simplifying my LinqToEF queries.

    Here is the refactored version:
    All is correct now :)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that contains all of my SQL objects, including the methods
First of all, Happy New Year to anybody out there reading this! I have
I have two objects, both of which are view controllers. The first (Ill call
Its my first time coming across such an error and i have looked around
I have a create action for a form that potentially generates errors (i.e. first
I have a customer who's Classic ASP application is generating ASP_0147 errors. The first
I'm getting two errors, both revolving around encoding and both related. The first error
Consider following 2 programs giving same error First calss: public class Testing { Testing
I get this cryptic error the first time (and only the first time) my
Possible Duplicate: Foursquare API for venue user image error I first noticed this problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.