2

I want to create an entity, lets say 'connection', between two existing entities. So far I have this:

BusinessLayer.context.DefinitionSet.attach(existingDefinition1);
BusinessLayer.context.DefinitionSet.attach(existingDefinition2);

DataEntities.context.ConnectionSet.add({
                SrcDefinition: existingDefinition1,
                DstDefinition: existingDefinition2
            });

When I run BusinessLayer.context.saveChanges() there is a post-request on DefinitionSet, which adds 2 definitions each time I add a connection.

Why is it adding 2 definitions instead of using the existing ones, or how can I avoid this? I've been strugling for too long.

--EDIT--

I've been fiddling with it and it is still giving me the issue. Please note that my initial question was simplified to show only my issue, so my JsFiddle is more exstenstive with more entities.

This is my JsFiddle:

http://jsfiddle.net/ghNCx/

HansElsen
  • 1,639
  • 5
  • 27
  • 47

0 Answers0