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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:32:10+00:00 2026-06-05T15:32:10+00:00

I’m developing a desktop application in WPF, application that is manipulating a considerable amount

  • 0

I’m developing a desktop application in WPF, application that is manipulating a considerable amount of data stored in a database. The application presents that data using diagrams and grids.

I chose to access the data using Entity Framework (code first). It is easy to use and the lazy loading is something I was looking for. Searching the NET, I discovered that Entity Framework seems to be designed to be used in a “Unit Of Work” strategy.

Lets take 2 simple expectations from my client:

  1. I want to print my data and be informed of the print progress.
  2. I want to generate a PDF report and be informed of the generation progress.

The client is seeing grids so he is expecting something closed to Excel.

  1. Printing and report generation should take into account all modifications made to the
    data.
  2. The modifications are not valid until saved by the user.

For instance, open excel, modify a worksheet, print it and close the application discarding changes.

  1. All worksheet was printed, including not saved data
  2. If I reopen the file, the unsaved data is no more there.

Assuming that I open a DBContext in the UI thread to manipulate data and accumulate changes and that I want to do the export in another thread because it is time consuming (a new DBContext), my changes to the data are not taken into account, except if I save the data.

So, what should I do …

  • Load the data from the database to XML files on disk and work on these files and put back the data on the database when saving?
  • Use a lot of imagination to put the DBContext in its own thread and make loading and lazy loading redirected to the DBContext thread?
  • Always save data in the DB, but when an “unsaved” flag or something like that?

Any suggestions are welcomed.

  • 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-05T15:32:12+00:00Added an answer on June 5, 2026 at 3:32 pm

    I would have the ViewModel expose an observable collection that gets loaded asynchrnosously so as to not block the UI thread. I would then expose a Command that provides the save functionality you are looking for. This way, you can access your modified objects (ObservableCollection) for printing and discard them if the user doesn’t hit the Save Command.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

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.