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>ContinueContinue reading “Generics in WCF Data Contract”
Monthly Archives: December 2014
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 andContinueContinue reading “Data Contract Serialization Events in WCF”
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. WeContinueContinue reading “Multiple bindings in self-hosted WCF Service”