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)

8 results in tag: foreign-key-relationship

How to add an EF6 Association to a Candidate Key / Unique Key which is not the Primary Key?

Using ...Schema First..., I have a database structure, as so...ExternalDataItems --- edataitem_id PK -- surrogate auto-increment - NOT for FK relation here datahash UX -- Candidate Key / Unique Index (binary(20)) ExternalMaps --- emap_id P...
edmx entity-framework entity-framework-6 foreign-key-relationship unique-key
asked by user2864740

How to get EF6 to honor Unique Constraint (on FK) in Association/Relationship multiplicity?

2019 Update / TLDR; switch to Entity Framework ...Core... (or whatever else)...While missing some "Features", EF Core properly honors Alternate Keys (aka Unique Constraints) in addition to Primary Keys and thus does a ...much... better job of honoring Rel...
entity-framework entity-framework-6 foreign-keys multiplicity unique-key
asked by user2864740

EF6 Does not generate foreign key association from database

PROBLEM:...I am trying to create a EF6 model using the database first approach. Simply speaking, I have 2 tables ...tblUser... and ...tblMilkMan... which have a foreign key relationship on the ...UserID... column. But when I create a new EDMX diagram and ...
c# entity-framework entity-framework-6 foreign-key-relationship sql-server
asked by Sajjan Sarkar

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

Entity Framework Code First unique index foreign key throws DbUpdate Exception

Here's the entites and context code:...public class Family { public int FamilyID { get; set; } public String address { get; set; } public virtual ICollection<Member> FamilyMembers { get; set; } } public class Member { [Index("MemberUniqueI...
c# ef-code-first entity-framework entity-framework-6 foreign-key-relationship
asked by Amai

Entity framework parent -> child linking and foreign key constrain failed error

I'm using entity framework 7 (core) and Sqlite database. Currently using comboBox to change entity category with this method:.../// <summary> /// Changes the given device gategory. /// </summary> /// <param name="device"></param> /// <param name="category...
c# entity-framework-core foreign-key-relationship sqlite
asked by ajr

Updating foreign key in Entity Framework 7

I am trying to update a foreign key using Entity Framework 7. But it is giving error: The property 'Y' could not be found in object 'X'. I have tried many different solution but still not working. The sample code:...class X { property Y {get; set;} -> p...
c# entity-framework entity-framework-core foreign-keys sql-server
asked by Jash

How do I model an alternate foreign key in Entity Framework Core

I'm trying to model a structure in EF, where we have multiple entities, each of which have localization content. All this localization content exists in a single table. (See example below)...I'm running into an issue, when I define the foreign keys with f...
ef-migrations entity-framework-core foreign-key-relationship
asked by jasper

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!