tify"> {get {return (IAsyncDomainStore ) Store; } {Store=value; }
}
virtual T CreateNew ()
{ObjectCloneHelper.CreateProxy ();
}
# region IDomainPersistenceStore Members
# region Async save methodsvirtual IAsyncResult BeginSaveObject (T obj, AsyncCallback saveCompletedCallback, object state)
{clone=ObjectCloneHelper.CloneReal (obj);. TrimStringProperties (); WrappedStore.BeginSaveObject (clone, saveCompletedCallback, state);
}
T EndSaveObject (IAsyncResult asyncResult)
{result=(T) ObjectCloneHelper.CloneProxy (WrappedStore.EndSaveObject (asyncResult));
cachedResult=AddToCache (result);
(cachedResult);
cachedResult;
}
virtual void OnSaveObjectCompleted (T obj)
{
}
/ / /
/ / / Begins asynchronous group save operation on set of object of type
/ / / virtual IAsyncResult BeginSaveObjects (IEnumerable objs, AsyncCallback saveCompletedCallback, object state)
{ realObjs=objs
. Select (obj => (T) ObjectCloneHelper.CloneReal (obj))
. Do (obj => obj.TrimStringProperties ())
. ToList ();
WrappedStore.BeginSaveObjects (realObjs, saveCompletedCallback, state);
}
/ / /
/ / / Ends initiated asynchronous group save operation
/ / / IList EndSaveObjects (IAsyncResult asyncResult)
{ originalCollection=WrappedStore.EndSaveObjects (asyncResult);
(T obj in originalCollection)
{(obj);
}
originalCollection.Select (obj => (T) ObjectCloneHelper.CloneProxy (obj)). Select (AddToCache). ToList ();
}
# endregion
# region Async delete methodsIAsyncResult BeginDeleteObject (ObjectKey key, AsyncCallback deleteCompletedCallback, object state)
{WrappedStore.BeginDeleteObject (key, deleteCompletedCallback, state);
}
ObjectKey EndDeleteObject (IAsyncResult asyncResult)
{result=WrappedStore.EndDeleteObject (asyncResult);
(result);
result;
}
IAsyncResult BeginDeleteObjects (IEnumerable keys, AsyncCallback saveCompletedCallback, object state)
{WrappedStore.BeginDeleteObjects (keys, saveCompletedCallback, state);
}
IList EndDeleteObjects (IAsyncResult asyncResult)
{ result=WrappedStore.EndDeleteObjects (asyncResult);
(var key in result) ...