I've read various threads on the usage of the UnitOfWork class too keep track of collection modifications in the UI and decided to implement this approach.
I'm having the issue of remoting the UnitOfWork object over to the Server. On the client form I add a new entity:
CddcategoryEntity newEnt = (CddcategoryEntity)entities.AddNew();
newEnt.Cddcategoryguid = 0m;
newEnt.Shasessionguid = 0m;
newEnt.Lastmodifiedtime = DateTime.Today;
newEnt.Categoryid = "REMOTINGTEST";
newEnt.Categorytext = "Remoting Test with LLBLGen";
When the user clicks store, I add the collection for save and call the remote store method which takes in a UnitOfWork class
uow.AddCollectionForSave(entities);
mgr.Store(uow);
At this point on the client, I can see that the uow has the object in the "_collectionsToSave." When I get to the remote store method, however, the UOW has null for the following members: _collectionsToSave, _entitiesToInsert, _entitiesToSave, _entitiesToUpdate, _objectIDsToSave. This leads to a object reference error when I try to do the Commit() on the UOW.
public void Store(UnitOfWork uow)
{
Transaction trans = new Transaction(IsolationLevel.ReadCommitted, "UOW");
uow.Commit(trans, true);
}
Is it that these members do not get serialized? Am I doing something wrong? Ive tried to do some research on the topic but the closest I have come is this thread which I could still use some clarification on.
http://llblgen.com/tinyforum/Messages.aspx?ThreadID=6650&HighLight=1
Further information: I am using self-servicing, .NET 2.0, and have tried both tcp and http remoting with binary formatting.
Thanks,
Milos