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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:19:48+00:00 2026-06-13T22:19:48+00:00

I have an issue with poco classes in EF 4. I have an Order

  • 0

I have an issue with poco classes in EF 4.

I have an Order entity wich contains a foreign key to a Customer entity.

So, the Order class has a navigation property of type Customer.

It’s look like this :

public class Order
{
     public virtual int Id { get; set; }
     public virtual CustomerId  { get; set; }
     public virtual Customer customer { get; set;}
     …
}

When I load an order, the navigation property customer is correct, but if the CustomerId property changes, the navigation property is not refresh with the new customer.

If I call the DetectChanges() method on the EF context, the navigation property is then refreshed.

I’ve read that with all properties marked as virtual, the relationship synchronisation is automatic, but it’s not the case here.

Where did I go wrong ?

Thanks for any help

  • 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-13T22:19:50+00:00Added an answer on June 13, 2026 at 10:19 pm

    It means that for some reason proxy was not created for you entity. Take a look at this blog post – http://blogs.msdn.com/b/adonet/archive/2009/12/22/poco-proxies-part-1.aspx. Here are the requirements for creating proxies: http://msdn.microsoft.com/en-us/library/vstudio/dd468057(v=vs.100).aspx. Proxy creation must not be disabled.

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

Sidebar

Related Questions

I have a model that contains a dictionary property. (this has been distilled from
I have created the POCO class and it's equivalent in edmx file (Category entity
Say I have the following POCO classes: public class Parent { public int ID
I have a POCO class as follows public class Category { public int ID
I have an assembly generated using POCO template using Entity Framework (e.g. Company.Models.dll).Besides generated
I have the following class in Class Library: Artist , which is a POCO
I have issue, after checkout on checkout/onepage/success get a user info using order id,
I have issue with url rewrite. I have a site example.com that has a
I have a strongly typed view inheriting from a POCO class. I want to
I have issue with: <form:checkboxes path=roles cssClass=checkbox items=${roleSelections} /> If previous line is used

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.