WCF Dynamic Client Proxy – Implementing IDisposable
February 19, 2009 7:28 pm WCF, WCF Dynamic ProxyAs my good friend and Readify colleague Buddhike observed the generated WCF Dynamic Proxy was not implementing IDisposable. This is a bit scary as I was quite sure I had that implementation prepared done already so all I can image is that for some reason (no source control?) I’ve been working on an older code base.
So, here is a new implementation that is implementation that implements IDisposable. The only trick is that you have to cast the received proxy to IDisposable in order to use it in a using statement. As a difference from the WCF implementation, the dynamic proxy does not throw at all from the implementation of the IDisposable so it’s safe to use in a using statement:
IService1 service = WCFClientProxy<IService1>.GetReusableFaultUnwrappingInstance("Service1"); using (service as IDisposable) { service.MyOperation1("a", 0); }
Please download the new version of WCF Client Proxy 1.3.1.
March 22nd, 2009 at 10:36 pm
thank you,goob job!
there is another project about WCF client in the CodePlex.
http://www.codeplex.com/SoftwareIsHardwork/
maybe you can get something instesting