Part #1 of the article can be read here If we have a DataContract Product.cs ServiceContract is as below IService1.cs And Service implementation is as below, Service1.svc.cs Now we have a service. Now at the client side (Say it as client1) we are calling the service as below Program.cs Output Now let us go aheadContinueContinue reading “Versioning in WCF Data Contract Part #2: Missing Members”
Author Archives: Dhananjay Kumar
Versioning in WCF Data Contract Part #1: Adding New Members
DataContract versioning requires when some modification has been done to the existing DataContract exposed to the client from the service or vice versa. If either service or client is changing the schema of DataContract exposed then new version of DataContract come into action and both party involved in communication should be able to accommodate theContinueContinue reading “Versioning in WCF Data Contract Part #1: Adding New Members”
Serialization order in Data Contract
If you have a Data Contract in your WCF service as below, Student.cs On serialization properties of data contract will get serialized in alphabetical order. So at the client side serialized data contract will look like So we can see in serialized data contract at the client side properties are serialized in alphabetical order. NowContinueContinue reading “Serialization order in Data Contract”
Using Lambda expression in FindAll()
I got a critical comment from @amazedsaint. You can read his blog http://amazedsaint.blogspot.com/ If you read my previous post http://dhananjaykumar.net/2010/10/01/findall-finding-multiple-items-in-c-list/ , I am using a method GreaterThanHun As predicate to pass as parameter to FindAll() Instead of that we can use 1. Anonymous method 2. Lambda expression So, I am going to show you hereContinueContinue reading “Using Lambda expression in FindAll()”
FindAll() : Finding multiple items in C# List
Let us say we have a list of integer and we want to find all the number greater than 100. If list is as follow List<int> lst = new List<int>(); lst.Add(20); lst.Add(300); lst.Add(400); lst.Add(9); lst.Add(19); lst.Add(789); ContinueContinue reading “FindAll() : Finding multiple items in C# List”
Authentication on WCF Data Service or OData: Windows Authentication Part#1
In this article, I am going to show how to enable windows authentication on WCF Data Service. Follow the below steps Step 1 Create WCF Data Service. Read below how to create WCF Data Service and introduction to OData. http://dhananjaykumar.net/2010/06/13/introduction-to-wcf-data-service-and-odata/ While creating data model to be exposed as WCF Data Service, we need to takeContinueContinue reading “Authentication on WCF Data Service or OData: Windows Authentication Part#1”
IgnoreDataMember attribute in WCF POCO Serialization
POCO stands for PLAIN OLD CLR OBJECT. If in WCF we are using 1. Complex Data type for example custom class 2. And not attributing this custom class as DataContract and properties of the class as DataMember 3. If we want to expose the below custom class to client and not using DataContractSeraliazer then allContinueContinue reading “IgnoreDataMember attribute in WCF POCO Serialization”
Inserting element in sorted Generic list (List) using binary search in C#
I got a mail asking, “How we could insert an item in sorted generic list such that after insertion list would be remaining sorted?” Answer of this is using Binary Search As we know Binary search works on Divide and conquer algorithm. And running time using Binary search is very efficient. So we need toContinueContinue reading “Inserting element in sorted Generic list (List) using binary search in C#”
Sorting a Generic List in C#
Objective This article will give code snippet on how to sort a generic list in C# I have a class called Product Product.cs class Product { public string ProductName { get; set; } public int ProductPrice { get; set; } } And List of Product as below, List<Product> prdListContinueContinue reading “Sorting a Generic List in C#”
Download PDF of Walkthrough on WCF 4.0 Service in Silver Light 4.0
Walkthrough of Consuming WCF 4.0 in SilverLight 4.0