LINQ to SharePoint with WCF 4.0

Objective How could we perform CRUD operations on SharePoint 2010 List from a WCF Service? Assume we need to create a WCF Service and that service will perform CRUD operation on SharePoint 2010 list. We are going to see that in this article. Flow Diagram Now we will follow the below steps to perform allContinueContinue reading “LINQ to SharePoint with WCF 4.0”

The Web Application could not be found .verify that you have typed the URL correctly error: SharePoint 2010 object model

The below exception is very frustrating when we start working with SharePoint object model. Let us investigate how to solve below exception Above Exception can encounter in two scenarios 1. Trying to use SharePoint 2010 object model in managed application like console or windows application. 2. Trying to use SharePoint 2010 object model in WCFContinueContinue reading “The Web Application could not be found .verify that you have typed the URL correctly error: SharePoint 2010 object model”

HTTP Error 404.3 : WCF Hosted in IIS. Add a MIME type

Normally when we host a WCF Service i9n IIS and while browsing we get the below frustrating screen Error message in above screen is very clear. We need to add MIME type for .SVC extension. To solve above problem 1. Open command prompt as Administrator 2. Navigate to C:Windows\Microsoft.Net\Framework\v3.0 3. Type the command ServiceMode1Reg.exe –iContinueContinue reading “HTTP Error 404.3 : WCF Hosted in IIS. Add a MIME type”

LINQ to SharePoint: CRUD operation on SharePoint 2010 list using SPLinq

Objective In this article, we will see how to work with LINQ to SharePoint. I have tried to address all the common errors we encounter when first time we start using LINQ against SharePoint. We will see , 1. How to insert an item in SharePoint list using SPLinq 2. How to update an itemContinueContinue reading “LINQ to SharePoint: CRUD operation on SharePoint 2010 list using SPLinq”

LINQ to SharePoint: SPLinq in SharePoint2010

Objective In this article, we will see how to work with LINQ to SharePoint. I have tried to address all the common errors we encounter when first time we start using LINQ against SharePoint. Assumption We have a custom list 1. Name of the list is Test_Product. 2. Columns of the list is as belowContinueContinue reading “LINQ to SharePoint: SPLinq in SharePoint2010”

Enumeration in DataContract of WCF

By default Enums are serializable. If we define Enum at service side and use it in Data Contract, it is exposed at the client side. For example, if we have an Enum as below, And we are using it in DataContract as below By default Enum is serialized. So, let us see the default behaviorContinueContinue reading “Enumeration in DataContract of WCF”

Accessing WCF service without creating Proxy

Each time when we want to consume a WCF service, we need to create proxy at client side. To create proxy, service must expose metadata endpoint. Normally 1. We create a WCF service 2. Expose metadata endpoint 3. Add service reference at client side to create the proxy. 4. Using the proxy calls the serviceContinueContinue reading “Accessing WCF service without creating Proxy”

Finding Odd numbers from a Range of Number using LINQ in C#

If we have a range of number from 1 to 20 and we want to find odd among them using LINQ . We have three options for that 1. Calling a Predicate 2. Anonymous Method 3. Lambda So here we can see that we need to pass a predicate to evaluate the condition. Calling aContinueContinue reading “Finding Odd numbers from a Range of Number using LINQ in C#”

Versioning in WCF Data Contract Part #2: Missing Members

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”

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”