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

  • SEARCH
  • Home
  • 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 7514525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:31:22+00:00 2026-05-30T00:31:22+00:00

I am trying to update the entity that has some columns with foreign keys.

  • 0

I am trying to update the entity that has some columns with foreign keys. Everything seems to work fine but during first time assignment, it takes more than 1 minute but if I execute the same action again , it comes immediately.

Code Snippet :

 public bool UpdateStatus(DetailDataModel DetailDataModel)
    {
        Details updateStatus = (from d in UnitOfWork.Details
                           where d.Id == DetailDataModel.Id
                           select d).FirstOrDefault();
        updateStatus.StatusId = DetailDataModel.StatusId;
        UnitOfWork.Commit();
        return true;
    }

Below is the culprit line :

updateStatus.StatusId = updateStatus.StatusId;

I cannot find the problem but when try to update other columns of the same entity, it works fine and the problem is only with Foreignkey columns. Is there any limitation for association with Entity framework.

Please suggest your thoughts on it, Thanks in Advance.

  • 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-30T00:31:23+00:00Added an answer on May 30, 2026 at 12:31 am

    I guess you are using POCO T4 Generator and you have lazy loading enabled because in such case the delay can be easily explained – fixup methods in generated POCO classes will cause lazy loading of Status entity and in turn lazy loading of all its related Details.

    If you don’t need lazy loading for this operation try to turn it off in your context otherwise you will have remove circular reference from your entity model (Status will not have navigation property to Details) or modify T4 template and remove those fixup calls.

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

Sidebar

Related Questions

I am troubleshooting code that is attempting to update a disconnected entity that has
My problem is that I'm trying to add a child entity, but keep running
I'm trying to update an entity and its related entities as well. For instance,
I trying to update a model on a callback but the validation is causing
I'm trying to update a hashtable in a loop but getting an error: System.InvalidOperationException:
I am trying to update my iPhone app to work with OS 3.0. I
I am trying to restore a DB using an SQL script, but things foreign
I'm trying to build a website that has a Member section, and I'm struggling
I'm having an issue when trying to programmatically update a DateTime field that already
I have an 'Interview' entity that has a one-to-one mapping with a 'FormSubmission' entity,

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.