0

I have two tables with below structures

A{Impid(PK),name,code,etc.....) B(Id(PK),Impid(FK && Unique),some columns)..

Basically its a one to one relationship (extension of table A columns).

I am trying to use in EF. could some one please help me setting up the model configurations for it?

Ducati007
  • 265
  • 1
  • 5
  • 14
  • If you're wanting a one to one relationship, there's already a [great post](http://stackoverflow.com/questions/3622572/how-to-declare-one-to-one-relationship-using-entity-framework-4-code-first-poco) about that – Mark Oreta Sep 05 '12 at 19:00

1 Answers1

0

EF doesn't support unique constraint so you must either change your DB and put FK on Id in B or you must map it as one-to-many and expose navigation property only on B (because on A you would need a collection of Bs).

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670