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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:34:48+00:00 2026-06-17T11:34:48+00:00

we use Azure Caching directly (and not through one of the available Entity Framework

  • 0

we use Azure Caching directly (and not through one of the available Entity Framework wrappers). Apparently, for distributed caching, we need to serialize the objects. Unfortunately, this causes issues with lazy-loaded DbContext-based proxies used for navigation properties.

I see we can use a custom serializer in order to map proxies to empty collections (if not loaded) or to normal objects (if loaded), but I am not sure about the implementation. One possible implementation can be based on the one used by WCF, but I am not sure Azure works the same way.

The ideal solution (and that’s why I point to ProxyDataContractResolver) would be one where, when serialization happens:

  • IF the navigation property has been already loaded the data would be serialized as if it were a normal Collection,
  • and if they are not loaded, they won’t be serialized (I would like lazy loading to work back after deserialization for the latter case, but it’s acceptable if it doesn’t).

Has anyone manually fixed that problem in an elegant way?

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-06-17T11:34:49+00:00Added an answer on June 17, 2026 at 11:34 am

    I will presume that if you are wanting to cache EF objects, you don’t require lazy loading or change tracking on those entities.

    I believe that both of those are enabled through object proxies that will cause serialization issues (since you don’t want to serialize the proxy).

    If you disable the property DbContext.Configuration.ProxyCreationEnabled then serialization of the actual object, not the proxy, should work fine. This is typically required when returning POCO objects over WCF but is likley the same for other serializations scenarios such as this.

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

Sidebar

Related Questions

I'm trying to use Windows Azure Caching Preview . I have one dedicated cache
Is there any java library available to use Windows Azure AppFabric Caching features? I
we want to use the azure appfabric for our software. But not every customer
I've just started to use Azure Websites to host one of the websites I'm
In Azure, sessions are not sticky so it's not sufficient to use InProc session
I currently use SQL Azure and Entity SQL in my application. e.g. Entities model
I would like to use azure caching to store session and output caching data.
We're working with Entity Framework in a Windows Azure environment and till now we
I'm trying to evaluate the use of Windows Azure storage/media/cdn services to host the
Just wondering what everyones thoughts on what ORM to use for SQL Azure? I'm

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.