Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hands on LINQ to SharePoint

Similar presentations


Presentation on theme: "Hands on LINQ to SharePoint"— Presentation transcript:

1 Hands on LINQ to SharePoint
Welcome Hands on LINQ to SharePoint Blog: Twitter: @PaulBeck1 Saturday, May 14, 2011 from 08:45 PM - 13:00 PM – Cobham South West London

2 Final Product Download the code What we are building
west-london.html What we are building

3 Final Product 2 related lists Orders and Customers

4 LINQ to SharePoint LINQ to SharePoint/SPMetal CAML
LINQ to SharePoint = SPLINQ = SPMetal Proxy LINQ to SharePoint/SPMetal Server OM CAML List SharePoint List data History of LINQ language-integrated query - extends C# and with native language syntax for queries and provides class libraries. LINQ syntax, lambda & strongly-typed

5 16/06/2018 SPMetal.exe SPMetal.exe is the tooling to generate the LINQ to SharePoint proxy code Generates strongly typed classes SPMetal.exe in 14\bin Syntax: spmetal /web:<url> /code:<file> /parameters:<file> Use parameters file, otherwise a class will be generated for each visible list, only show id and version from the hidden fields More flexible CKSDev for generating the LINQ to SharePoint proxy C# or VB.NET

6 Issues with LINQ to SharePoint
“Inefficient” queries – Querying data, Joins .ToList() - Non CAML compliant queries need to work around using LINQ to Objects. Add hidden fields, hide lists (parameters file) Only supports SP2010 foundation fields Attachments, managed metadata, custom site columns requires ICustomMapping. SPMetal cannot query cross site collections External Content Types are not supported

7 16/06/2018 Selecting & Update Similar to T-SQL Lamda expressions

8 Insert

9 Delete

10 Display CAML Generated Code

11 Custom Site Columns The business entity class has to implement the ICustomMapping interface

12 Thank-you Blog: http://blog.sharepointsite.co.uk Twitter: @PaulBeck1
Reference & Thanks: Paul Schaeflein Todd C. Bleeker Serge Luca Mostafa Elzoghbi Ted Pattison


Download ppt "Hands on LINQ to SharePoint"

Similar presentations


Ads by Google