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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:23:16+00:00 2026-05-28T02:23:16+00:00

I have a stand-alone console app which polls the db periodically for changes. I

  • 0

I have a stand-alone console app which polls the db periodically for changes.

I want to ensure if anyone makes changes to the Db from the web front-end, the console app gets an updated list of entities.

I’ve been looking at the .Reload() method but this seems to work only on a single entity. I want my select statement on the repository layer to get a refreshed list, as well as any item changes within the list. Effectively a refresh of the whole context for this particular entity.

How do I achieve this, without creating a new context? The reason for not creating a new context is that I want to be able to still unit test and inject the repo into the consuming service without creating a concrete implementation inside the service.

  • 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-28T02:23:17+00:00Added an answer on May 28, 2026 at 2:23 am

    Why do you need long living context? You didn’t mentioned any valid reason. You can inject factory instead of context to your service. Factory will hide context creation and your service will be able to create as many contexts as it needs to. Long living context is problematic and should be avoided.

    Anyway if you need to refres some data you can change MergeOption for the set (or ObjectQuery):

    context.MyEntitySet.MergeOption = MergeOption.OverwriteChanges;
    var data = context.MyEntitySet.ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a great stand-alone web form in asp.net utilizing many jQuery features
I have WCF service which launches the remote process from Process.Start successfully on stand
I have a requirement to create a component which can be used stand-alone or
I have one stand alone client server application. I want to move it to
I have a stand-alone JMS app that subscribes to several different JMS topics. Each
I have a problem that I feel is best implimented in a stand alone
I have a standalone Java app that has some licensing code that I want
I have a stand-alone svg file that displays without problems. It includes some inline
We have developed a stand-alone script on the same server as our Joomla 1.5
I have this command: Write-Host 123`r456 Output in stand-alone PowerShell: 456 Output in PowerShell

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.