开发者

Association not imported in EF4 designer for non-primary key

The relationship 'FK_EXTERNAL_ISMARKETI_MARKET开发者_StackOverflow社区IN' has columns that are not part of the key of the table on the primary side of the relationship. The relationship was excluded.

USE [Instruments.UnitTest] GO

ALTER TABLE [Instr].[ExternalIdentification]  WITH CHECK ADD  CONSTRAINT [FK_EXTERNAL_ISMARKETI_MARKETIN] FOREIGN KEY([InstrumentID], [MarketInstrumentID])
REFERENCES [Instr].[MarketInstrument] ([InstrumentID], [MarketInstrumentID])
GO

ALTER TABLE [Instr].[ExternalIdentification] CHECK CONSTRAINT [FK_EXTERNAL_ISMARKETI_MARKETIN]
GO

I'm using an association for NON-PRIMARY KEY columns, is this possible in the EF4?


Such associations are not supported in EF v4.


Its explained in more detail in this post here

http://www.cognitiveinheritance.com/post/Using-the-Entity-Framework-with-databases-that-have-foreign-key-relationships-that-do-not-link-to-the-primary-key-of-the-child-element.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜