I'm following the Using CSLA Data Portal e-book where it talks about implementing a custom proxy factory so that an app can support occasionally connected scenarios.
The SL example project shows the custom class that implements Csla.DataPortalClient.ProxyFactory. This doesn't appear to be valid interface within the Csla namespace for WinRT in v4.5.501. I do see IDataPortalProxyFactory, but this interface doesn't contain an overridable GetProxy method, which is necessary.
Are there changes in 4.5.501 that changes how I should create a custom proxy factory? Thanks.
After some experimenting, it seems like this works (i.e. the BO executes on either the local or remote portal when necessary). Is this a legitimate way of creating a custom proxy factory?
public
class ProxyFactory : Csla.DataPortalClient.IDataPortalProxyFactory
{
public IDataPortalProxy Create(Type objectType)
{
if (bPullFromLocal)
return new Csla.DataPortalClient.LocalProxy();
else
return new Csla.DataPortalClient.WcfProxy();
}
}
Also, what does the ResetProxyType method do? When should I use it?
Yes that is the intent of the new interface.
The ResetProxyType method is used to clear any cached proxy type your implementation may store. In your case you aren't storing a proxy type so you don't care, but in the DefaultPortalProxyFactory the proxy type is cached to improve performance.
Copyright (c) Marimer LLC