zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

7 results in tag: table-per-hierarchy

Issue with many-to-many relationship + TPH inhertitance in Entity Framework 6

I am running into an issue with EF6, though I'm fairly sure that this applies to previous versions that support this type of mapping. I fear I know the answer to the question at hand, but I hope that I am doing something wrong, or there is a better workar...
c# entity-framework entity-framework-6 many-to-many table-per-hierarchy
asked by joelmdev

EF6 - TPH foreign key mapping in derived classes using base class property

I am using Entity Framework 6.0.2 with an existing database in which tags are stored in a single table that looks like this:...Id...: int, primary key ...TagType...: string, determine the type of tag, either "usertag" or "movietag"...ItemId...: int, c...
c# entity-framework entity-framework-6 single-table-inheritance table-per-hierarchy
asked by Erik Schierboom

Table-per-hierarchy and composite primary key

I have two tables in a legacy database (which I cannot modify) with data as follows:...Table1 has a composite primary key (Code, Abbrev), but Abbrev is also used as a discriminator (see below). Table2 has two foreign key columns (CodeA, CodeB), both refer...
c# composite-primary-key entity-framework entity-framework-6 table-per-hierarchy
asked by Tomaz Tekavec

Entity Framework adds redundant duplicate discriminator column to table

I've been searching already for hours and I can't seem to find the issue....I am building an Entity Framework Fluent Api Code First TPH app. When I Add-Migration EF add's my "Type" column just fine, but it also adds a redundant Discriminator column (it sh...
c# ef-fluent-api entity-framework entity-framework-6 table-per-hierarchy
asked by qubits

EF Core, table-per-hierarchy and referencing entity of the same base class generates error

We have contacts are stored via table-per-hierarchy, A contact is either a company or a person and a person always belongs to a company. Both inherit from contact....EF Core 2.1 is used....It looks like this...public abstract class Contact { public vi...
c# entity-framework-core table-per-hierarchy
asked by Arikael

Entity Framework core 3.1.1 Multilevel Inheritance

An exception is thrown while running add-migration (EF core 3.1.1):...CLR property 'DiscriminatorLevel2Id' cannot be added to entity type 'CustomerBase' because it is declared on the CLR type 'InternalCustomer'...The following Image shows the needed hiera...
c# entity-framework-core table-per-hierarchy
asked by Mai ...

Possible to call a stored procedure on a Table-Per-Hierarchy table in EF Core 3.1?

I'm moving from EF Core 2.2 to 3.1. ...One breaking change (#15392)... was that it no longer composed over stored procedures, so you had to add 'AsEnumerable'. That usually works, but I have a stored procedure call on a TPH table where that fails:...My ca...
entity-framework-core table-per-hierarchy
asked by Jason

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!