setting an association on non primary key gives an error

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 2
Joined: Wed 19 Jan 2011 15:31

setting an association on non primary key gives an error

Post by yusufbs » Wed 19 Jan 2011 16:01


I am trying to create a devart entity model.

I have 2 tables

yyyRequest (composite key of DealerId, RequestId, AppInd)
... other data

yyyEqu (composite key of DealerId, PersonId, requestId)
... other data

The 2 tables have got different fields in primary key, so no foreign key is set at the db level

When I drag the tables in the .edml file, there is no problem,

Then I want to set association for (DealerId, PersonId, requestId) between the 2 tables

When I do this even for 1 field, it gives me the following error

Properties referred by the Principal Role YyyRequest must be exactly identical to the key of the EntityType XTRAModel.Request referred to by the Principal Role in the relationship constraint for Relationship XTRAModel.YyyRequest_YyyEqu. Make sure all the key properties are specified in the Principal Role.

Please note, I cannot change the structure or constraints of the tables

Please let me know if there is any solution for this

Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 21 Jan 2011 11:06

Unfortunately, EF does not support such associations.
You can try switching to LinqConnect, its association limitations are not that severe. I have made a test and the association was added successfully.

Post Reply