Month: December 2014
-
Generics in WCF Data Contract
In my WCF training, I often get questions that can we expose a generic type as DataContract in WCF? Yes, WCF allows us to expose the generic types as Data Contract. Let us say we have a generic type Foo. We can apply data contract on the Foo as follows: We can use Foo<T> […]
-
Data Contract Serialization Events in WCF
In WCF we use the DataContract to serialize and deserialize the custom data. Sometime you may come across a scenario do some work before or after the data gets serialized or deserialized. These are following four events provided on the DataContract. You are free to give any method name provided method should return void and […]
-
Multiple bindings in self-hosted WCF Service
Even though WCF is now, more than 5 years old but still I see developers struggling with the multiple bindings specially when hosted in a managed console application. In this post, step by step we will learn to create a WCF Service with multiple bindings and host the service in a managed console application. We […]