Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 588815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:21:30+00:00 2026-05-13T15:21:30+00:00

I am trying to implement a logical delete senario across all my entities. All

  • 0

I am trying to implement a logical delete senario across all my entities. All have an IsDeleted boolean property. I would also like to cascade the association deletes also. I started by adding a partial method for the entity to the datacontext.

partial void DeleteQuestion(Question instance)
{
    instance.IsDeleted = true;
    ExecuteDynamicUpdate(instance);
    foreach (var answer in instance.Answers)
    {
       DeleteAnswer(answer);
    }
}

This throws an error Incorrect syntax near the keyword 'WHERE' at ExecuteDynamicUpdate. Looking at sql profiler I can see the set clause is blank, it is not recording the IsDeleted = true; as a change. I checked the IsDeletedChanging event and it does get fired but I guess the change set has been built already by this time.

I also tried submitting the changes instead of calling ExecuteDynamicUpdate but this throws the exception The operation cannot be performed during a call to SubmitChanges.

I have seen an identical discussion here with the only resolution being to use stored procedures which I would rather not do.

So I thought lets ask the SO community and get a proper answer to the top of the Google results. There seems to be little on this topic.

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:21:31+00:00Added an answer on May 13, 2026 at 3:21 pm

    Do you really need to persist the deleted state in the entire containment heirarchy?

    Say you have a question “Q” and answers “A” and “B”.
    At some point you safedelete “A”.
    (State 1) “Q has B”.

    Now you safedelete “Q”, expecting that when you undelete “Q” you will get (State 1).
    But safedelete has set “B” to deleted state, and undelete have set all children of “Q” to undeleted state, then you get “Q has A, B”.
    Both safedelete and undelete operations have destroyed the state of children collection elements.

    I call this concept “distructing editing”, which means operations are irrevertible, and makes logical delete pretty much useless.

    I would recommend using “non-descrtructing editing”, which implies inference of IsDeleted state from containment hierarchy. If a parent IsDeleted, this means a child is considered deleted too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All I am currently trying implement something along the lines of dim l_stuff as
trying to implement a dialog-box style behaviour using a separate div section with all
What I'm trying to do is to implement something like the fruit machine scroll
I'm writing an MVVM configuration interface, and I'm trying to implement an expand/collapse all
I'm trying to implement hough transform for lines in matlab. And I have been
I'm trying to figure out a logical and quick way to implement the PRG
In trying to implement role based security for a web app, I have a
I am trying to implement the logical connective AND, and was wondering if this
Trying to implement a rating system of users and postings. What is the best
Trying to implement a UITableView of names similar to the built-in Contacts iPhone app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.