Good Tip, got my 5!
As an alternative to your tip, when using generated proxies you could also add the logic to a partial class with the same name as the proxy class, see below.
public partial class MyGeneratedProxyClient : IDisposable
{
void IDisposable Dispose()
{
try
{
if (this.State == CommunicationState.Faulted)
this.Abort();
else
this.Close();
}
catch
{
this.Abort();
}
}
}
Patrick Kalkman is a senior Software Architect with more than 20 years professional development experience. He works for
SimpleTechture where he helps teams develop state of the art web applications.
Patrick enjoys writing his
blog. It discusses agile software development. Patrick can be reached at patrick@simpletechture.nl.
Published Windows 8 apps:
Published Windows Phone apps:
Awards:
Best Mobile article of March 2012
Best Mobile article of June 2012