SPMetal Extender helps SharePoint 2010 C# developers to circumvent LINQ to SharePoint 2010 limitations. You can extend the fields that SPMetal generates (including SharePoint Server 2010's) including: taxonomy, publishing HTML, publishing image, attachments, created by, modified.What is the Purpose of the SPMetal Extend for SharePoint 2010?
Linq to SharePoint has several limitations, there are various techniques to improve SPMetal code generation. This project provides a Visual Studio extension to allow developers to easily work with list fields that are not covered by SPMetal's code generation. The extension provides additional functionality to the server explorer to allow the developer to generate code to extend Linq to SharePoint's functionality. For example, SPMetal does not generate strongly typed properties for lists fields based on "Publishing Html" or "Taxonomy" site columns.
There are two main components to the solution:Field code generation
- Using Visual Studio's "Server Explorer", you can connect to SharePoint sites and review items in the site. You can navigate to any list in the site and the SPMetal Extend VSIX extension generates the code required to extend the unsupported fields.SharePoint code Item Template
- This is an example template that can be added which demonstarates how to extend SPMetal for multiple unsupported columns for a list using Linq to SharePoint. The code should be filled out for the specific project. The item template provides the basic code structure and includes an example code to display attachments, publishing images, publishing html fields and the created by columns.
Note: Hidden fields can be retrieved using the technique used in the template however, you should preferably use SPMetal to include these parameters i.e. use the parameters.xml file to include the columns you want. It is included in the item template as occasionaly the SPMetal can't be regenerated and this technique allows you to retrieve the data consistantly using Linq to SharePoint.