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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:16:13+00:00 2026-06-16T04:16:13+00:00

(1) Can someone please explain the difference between performing data access using the two

  • 0

(1) Can someone please explain the difference between performing data access using the two different methods described below?

context.Refresh(RefreshMode.ClientWins, context.ParentEntity);

and

return (from pe in context.ParentEntity select pe).ToList();

(2) And for a more complicated example with child entities/navigation properties involved, are there any fundamental differences between these two calls:

context.Refresh(RefreshMode.ClientWins, context.ParentEntity);
context.Refresh(RefreshMode.ClientWins, context.ChildEntity);

and

return (from pe in context.ParentEntity.Include("ChildEntities") select pe).ToList();

(3) Finally, we have some code that performs a combination of the two methods:

context.Refresh(RefreshMode.ClientWins, context.ParentEntity.Include("ChildEntities"))

I’m trying to get my head wrapped around when one method should be used over another or if they are all functionally equivalent.

  • 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-16T04:16:14+00:00Added an answer on June 16, 2026 at 4:16 am

    I think you have the wrong ideas about Refresh and Include…

    “Refresh has the dual purpose of allowing an object to be refreshed with data from the data source and being the mechanism by which conflicts can be resolved” (from MSDN)

    “Include specifies the related objects to include in the query results.” (from MSDN)

    So to answer your question, Refresh is a void method and NOT a query… It is used to manage concurrency and resolve conflicts… I’m not sure if you were trying to get results back from this, but I can’t imagine it worked very well!

    Your (from pe in context... statements are LINQ queries making use of the Include method, which (like it sounds) includes the specified objects in the query results.

    Taking a look at the MSDN pages for the methods can usually help quite a bit when you’re not sure what they are doing.

    Hope this helped!

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

Sidebar

Related Questions

Can someone please explain the difference between the following methods to me? it should
Can someone please explain the difference between datum() and data() in D3.js? I see
Can someone please explain the difference between these two examples in the context of
Can someone please explain to me the difference between these two blocks of code.
Can someone please explain to me the difference between methods and events in the
Can someone please explain the difference between the following two options of Tortoise SVN
Can someone please explain to me difference between extends and super in java generics
Can someone please explain to me the difference between the AppSettings and ApplicationSettings sections
Can someone please explain with example that I can understand about the difference between
Can someone please explain the difference between ViewState and Session? More specifically, I'd like

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.