2 Oct 2011

LINQ to SharePoint


  • LINQ stands for Language Integrated Query
  • SharePoint works on top of Microsoft .NET Framework 3.5, not .NET 4.0
  • LINQ provides a methodology that simplifies and unifies the implementation of any kind of data access.
  • It facilitates the implementation of several existing architectures for accessing data
    • RAD/prototype
    • Client/server
    • N-tier
    • Smart client
  • LINQ includes many providers suitable for accessing several different types of data sources, few are:
    • LINQ to Objects
    • LINQ to SQL
    • LINQ to Entities
    • LINQ to DataSet
    • LINQ to XML
  • With LINQ you can use the same query syntax over different models.
  • When using LINQ to SharePoint, the query provider generates a CAML query that will be executed against the target SPList using the standard Server Object Model querying syntax.
  • image

  • The key feature of LINQ to SharePoint is that it can query SharePoint data with a fully-typed approach
  • SPMetel.exe automatically generate entities for you
  • it is good practice to use LINQ to SharePoint only against sites that have a well-defined and stable structure.


Limitations of LINQ to SharePoint and CAML queries:

  • The LINQ to SharePoint query provider has some limitations, due to its use of CAML queries under the covers. For example, with CAML, you cannot query more than one list at a time, so you can’t use a group join.
  • LINQ to SharePoint does not support multi-fetch queries that query across multiple lists, or join clauses on fields other than Lookup fields.
  • You cannot define queries across multiple websites or that query different DataContext instances.
  • You cannot use mathematical functions, because CAML does not support them.


Complete list of unsupported syntax and commands, please refer to MSDN http://msdn.microsoft.com/en-us/library/ee536585.aspx

No comments:

Post a Comment