Software Environment Details:
-Visual Studio 2017
-.NET Framework 4.5
We have a WCF Service and WCF Client Library C# library.
In order to adhere to proper coding practices, I want the WCFService that I'm coding to also implement the System.ServiceModel.IClientChannel interface.
However, if my WCF Service classes implements the System.ServiceModel.IClientChannel interface then I have to implement a whole bunch of methods that I don't need to use.
However, I am only interested in using
IClientChannel.Close();
and
IClientChannel.Abort();
I could resort to coding:
((IClientChannel)blahblahWcfChannel).Close()
((IClientChannel)blahblahWcfChannel).Abort()
However, invoking the aforementioned casting code looks messy.
Therefore, could someone please show me code that will allow me to invoke the IClientChannel Close() and/or Abort() , but without having to implement all the methods within the System.ServiceModel.IClientChannel interface and/or resorting to the messy casting?