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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:43:27+00:00 2026-06-02T07:43:27+00:00

I have a working WPF app using MVVM pattern in which the ViewModel calls

  • 0

I have a working WPF app using MVVM pattern in which the ViewModel calls Queries that do all the save/update/get/delete stuff. I did this because it’s easy to modify that queries to swap storage system, for example.

The app is working fine if the data is stored/deleted on the fly but the client wants a Save button so I have to remember (or Nhibernate) which changes are made. I don’t want to have a session open long time so I don’t know best way to do it. Do you know any pattern/architecture that would work?

  • 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-02T07:43:28+00:00Added an answer on June 2, 2026 at 7:43 am

    this worked for me for a simple app:

    • open session for viewmodel
    • if not use a transaction then Flushmode.Never (prevents queries from flushing)
    • use id generator which generates client side ids (hilo, guidcomb,…)
    • dont use Flush after the CRUD
    • check session.IsDirty to enable savebutton
    • if save -> flush() or commit
    • if cancel -> Dispose session or rollback

    NH will then send all actions at the end on flush

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

Sidebar

Related Questions

I am working on a WPF app using the MVVM patterm, which I am
I'm building a WPF application and working with the MVVM pattern. I have 4
I have a WPF app that is currently driven completely from XAML. All fields,
I have an application I am creating in WPF, using MVVM pattern. In this
I am working on a WPF MVVM Project. Now i have a DataGrid in
I have a project I'm working on that requires our WPF application read SMS
I'm working on a word processor-type app using the WPF RichTextBox. I'm using the
I have a wpf app that shows 5 different usercontrols as you go through
I have a WPF 4 app which I want to enable drag and drop
I'm working on a C# WPF app with a MySQL backend using Entity Data

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.