legacy-database

How can I use TPT inheritance models when primary keys have different names?

社会主义新天地 提交于 2019-12-03 20:31:22
问题 Using Entity Framework 4.1 against a legacy database, I'm unable to generate a working set of TPT inheritance models that aren't pluralized and use different names for a common primary key. I am using database tables Organization, Account, and Company as illustrated below: Organization OrganizationID (int PK) OrgName (varchar) Company CompanyID (int PK) CompanyNo (varchar) Account AccountID (int PK) AccountNo (varchar) Account.AccountID and Company.CompanyID have a FK constraint that values

How can I use TPT inheritance models when primary keys have different names?

久未见 提交于 2019-11-30 16:25:24
Using Entity Framework 4.1 against a legacy database, I'm unable to generate a working set of TPT inheritance models that aren't pluralized and use different names for a common primary key. I am using database tables Organization, Account, and Company as illustrated below: Organization OrganizationID (int PK) OrgName (varchar) Company CompanyID (int PK) CompanyNo (varchar) Account AccountID (int PK) AccountNo (varchar) Account.AccountID and Company.CompanyID have a FK constraint that values in those columns must also be contained in Organization.OrganizationID so neither can exist without a