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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:10:01+00:00 2026-05-24T07:10:01+00:00

In the book Entity Framework 4 in Action , in section 16.1.3 and again

  • 0

In the book “Entity Framework 4 in Action“, in section 16.1.3 and again in 16.2.4, it is stated

If you have a proxy instance, remember to disable lazy loading before
serializing, or you’ll end up sending unwanted data to the client.

However, the authors never say how to disable lazy loading. In my own searches, I’ve heard of ContextOptions.LazyLoadingEnabled. Is that “the way” this is done? Is there more than one way (besides disabling proxy generation)?

I read in one article that the LazyLoadingEnabled flag only pertains to EntityObject entities, not POCO entites:

Turning lazy loading off will now allow your classes to be serialized
properly. Note, this is if you are using the standard Entity
Framework classes. If you are using POCO, you will have to do
something slightly different.

With POCO, the Entity Framework will create proxy classes by default
that allow things like lazy loading to work with POCO. This proxy
basically creates a proxy object that is a full Entity Framework
object that sits between the context and the POCO object. When using
POCO with WCF (or any serialization) just turning off lazy loading
doesn’t cut it. You have to turn off the proxy creation to ensure
that your classes will serialize properly

I suspect the above commentary is simply erroneous.

  • 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-24T07:10:02+00:00Added an answer on May 24, 2026 at 7:10 am

    Yes, ContextOptions.LazyLoadingEnabled is “the way.” The serialization issue is related, but different. Proxies have a different runtime type. That can mung serialization. The only relation to lazy loading is that pure (non-proxy) POCOs don’t do lazy loading.

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

Sidebar

Related Questions

I have created a Entity Framework mapping based on the book Microsoft Entity Framework
On my Core Data Entity Book i have a boolean property, 'wasViewed' (NSNumber numberWithBool)
I am fairly new to Entity framework as well as LINQ. I have used
Reading a book on Entity Framework and they say that LINQ is only available
I am interested in learning all about the Entity Framework. I have found these
i started to read Entity Framework Book. in first part of book it describes
I have a simple WCF project that uses the Entity Framework to access the
I am new to Entity Framework but have spend a lot of time reading
I have been following the new Steve Sanderson MVC3 framework book from Apress and
Is ADO.NET 4 the same as Entity Framework 4? I'm looking for a book

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.