Skip to content

Circle mappings causing problems with DeleteOnSubmit #2

Description

@toSilence

Hi,

I think the problem is in 'EntiySession.cs' method 'GetOrderedItems()'.

In our project we are heavily using delete and insert on submit.
I just recognize that the delete statement are causing Foreign Key exception on sql server.

For example:
Objects: Customer, Land
Customer maps Land
Land maps Customer

Foreign Key Customer --> Land

If I write the delete statement in the correct order.
DeleteOnSubmit(Land, adressItem1);
DeleteOnSubmit(Customer, customer1);

SubmitChanges() --> GetOrderedItems() it trys to detect the mapping

but I have to map both:
Customer --> Land, Land --> Customer

It always returns Customer to delete first which is causing a foreign key exception.

I will implement a fix that will work on our side.

Any reply would be welcome.

BR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions