【发布时间】:2011-10-11 15:52:55
【问题描述】:
我有一个无法更改的数据库架构,并且它的表可以相互引用而无需声明明确的外键关系。例如:
create table Foo (
Id int identity not null primary key,
X int
)
create table Bar (
Id int identity not null primary key,
FooId int, -- as if "references Foo(Id)"
Y int
)
我想通过 EntityFramework(4.0 或 4.1)访问这些表。是否可以让 EF 将 FooId 视为引用表 Foo 的外键?
【问题讨论】:
标签: .net database entity-framework