Last modified: July 15, 2011
Applies to: SharePoint Foundation 2013 | SharePoint Server 2013
Specifies that a list should be included in code generation and modifies which content types in the list are included in code generation.
The following sections describe attributes, child elements, and parent elements.
The name of the list in SharePoint Foundation.
The name SPMetal gives to the property that it generates to represent the list.
Specifies the return type of the property.
Includes a content type for code generation and modifies which fields (columns) in the content type are included in code generation.
Excludes a content type from code generation.
The following is an example of a List element in use. If this is a hidden list, the presence of the element ensures that it is included in code generation. The example also contains a ContentType element that ensures that the content type class for the list content type is named "TeamMember" instead of the default "TeamMembersItem".
<?xml version="1.0" encoding="utf-8"?> <Web AccessModifier="Internal" xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal"> <ContentType Name="Contact" Class="Contact"> <Column Name="ContId" Member="ContactId" /> <Column Name="ContactName" Member="ContactName1" /> <Column Name="Category" Member="Cat" Type="String"/> <ExcludeColumn Name="HomeTelephone" /> </ContentType> <ExcludeContentType Name="Order"/> <List Name="Team Members"> <ContentType Name="Item" Class="TeamMember"” /> </List> </Web>