Monday, November 23, 2009

Using Linq To SharePoint in 2010


SharePoint 2010 comes with SpMetal tool that auto-generate entity types based on a list definition. It uses the SharePoint Lists web service to get the schema of a list.

This tool is located at c:\program files\common files\microsoft shared\web server extensions\14\bin

The syntax is

spmetal.exe /web:SITE-URL /namespace:YOUR_NAMESPACE /code:CLassName.cs