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)

5 results in tag: composite-primary-key

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

EntityFramework - Composite Key Table with FK to another Composite Key Table

I've ...two tables... both with ...composite primary keys.... ...Both... have in common ...one of the primary key's with a foreign key... to another table....The problem is that when i create the migrations, it messes up the foreign keys....I must use dat...
asp.net-mvc-5 composite-primary-key entity-framework entity-framework-6 foreign-key-relationship
asked by Leandro Soares

How should I define a composite primary key for an existing database table?

I'm working on a Core MVC project that reads data (no writing required) from a pre-existing database. Unfortunately this database is a total mess, but I cannot change anything in it (and even if I could, I wouldn't touch it with a 10-foot pole)....Some of...
composite-primary-key ef-database-first entity-framework entity-framework-core sql-server
asked by George T

Entity Framework 6 Database First Doesn't Generate Entity on Table With Composite Key

Suppose I have the following table definition with a composite primary key:...create table [dbo].[CustomerRequests] ( [CustomerId] int not null, [RequestId] int not null, constraint [PK_CustomerRequests] primary key clustered ([CustomerId] asc...
composite-primary-key ef-database-first entity-framework entity-framework-6 sql-server
asked by Chris Schiffhauer

How to use foreign key as composite key in EF Core 2?

I have several classes in EF Core 2. 1) Class Ser...has id as Guid type. It is a primary key, auto-incremented....2) Class SerStaHis...has SerId as Guid type. It is a foreign key to Class Ser. It is a primary key with timestamp...has timestamp. It is a p...
c# composite-primary-key ef-core-2.0 entity-framework-core foreign-keys
asked by hunterex

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!