I'm experiencing an issue refreshing data in XPCollection after commiting some database changes using UnitOfWork.
I have a WinForm with an XPCollection.
The XPCollection uses XpoDefault.Session.
I do some changes through a UnitOfWork:
using (UnitOfWork uow = new UnitOfWork())
{
var photos = new XPCollection<Photo>(uow);
photos[0].Date = DateTime.Now;
uow.CommitTransaction();
}
To get the original XPCollection to update the changes, I've tried the following:
foreach (Photo photo in myXPCollection)
{
XpoDefault.Session.Reload(photo);
}
foreach (Photo photo in myXPCollection)
{
photo.Reload();
}
myXPCollection.Reload()
None of the methods work.The changes are not reflected in the original XPCollection.
They are only visible when I start with a completely new Session. Obviously, this is a big performance problem.
How to get the changes made using UnitOfWork to another Session?