开发者

Association not imported in EF4 designer for non-primary key

开发者 https://www.devze.com 2022-12-28 01:45 出处:网络
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

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

精彩评论

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