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 8318183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:52:28+00:00 2026-06-08T21:52:28+00:00

Using the default code generated entities with Entity Framework, is there a way to

  • 0

Using the default code generated entities with Entity Framework, is there a way to delete an entity object without using the ObjectContext? For example, self-tracking entities have a MarkAsDeleted method. Also, the ObjectContext isn’t needed to update or add objects, so I’m hoping the same applies to deleting objects.

One thing that doesn’t work is to simply mark the entity as deleted since the property is readonly:

foo.EntityState = EntityState.Deleted;
  • 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-06-08T21:52:30+00:00Added an answer on June 8, 2026 at 9:52 pm

    Answer seems to be no, so I’m using a technique I wrote about before to attach the ObjectContext to all entities that need to delete child entities: http://sixfeetsix.blogspot.com/2012/06/provide-entityobjects-access-to-their.html

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

Sidebar

Related Questions

I'm using Entity Framework Code First to generated my database, so I have an
Even using the default test code on my app I can't get this working.
The Default code used to LIMIT the results fetched from the MySQL database using
I have some code using Lucene that leaves the default conjunction operator as OR,
I'm using following code to locate location on default google map. Uri uri =
When defining a string in a class using Code First, the default for the
I'm using the default generated asp page in visual studio. (I have edit the
Here's the code that is generated by default <div id=ui-datepicker-div class=ui-datepicker ui-widget ui-widget-content ui-helper-
I am using ADO.NET Mocking Context Generator plugin for my Entity Framework model. I
I want to change the default code generated by visual studios 'add->class...' for C

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.