This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Is there any way to flush pending changes to the database in a UnitOfWork without calling SaveChanges; the equivalent of the reset parameter in SaveChanges of UnitOfWork? When I call SaveChanges(true) of one of my UnitOfWork, it clear all existing entities from UnitOfWork so that they will be reloaded on subsequent queries. This feature is very nice when you want to keep your UnitOfWork lives a long time (for Windows form) but some changes can be made in the database by other process and you want to make query at some intervals and take the latest changes from the database and not from the UnitOfWork. Do you have a function like UnitOfWork.FlushPendingChanges? Thank you. |
|
|
Do you mean to flush your changes to the database, or to reload/refresh your UOW with the latest data in the database? If the former, then this is just IUnitOfWork.SaveChanges(). If the latter, then no, this is not currently possible. You will need to create a fresh unit of work and load into that. |
|