Share via


ExcludeOtherLists (SPMetal)

Applies to: SharePoint Foundation 2010

Specifies that SPMetal generates code only for lists that are explicitly represented by List elements.

Web (SPMetal)
  ExcludeOtherLists (SPMetal)

<ExcludeOtherLists />

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

None.

Parent Elements

Element

Description

Web (SPMetal)

Specifies the name and access level (public or internal) of the class (derived from DataContext) that SPMetal generates.

Remarks

A Web element cannot have both an ExcludeOtherLists element and an IncludeHiddenLists element.

Example

The following is an example of an ExcludeOtherLists element in use. In this case, it ensures that the "Team Members" list is the only one for which SPMetal generates a property declaration.

<?xml version="1.0" encoding="utf-8"?>
<Web AccessModifier="Internal" xmlns="https://schemas.microsoft.com/SharePoint/2009/spmetal">
  <List Name="Team Members">
    <ContentType Name="Item" Class="TeamMember" />
  </List>
 <ExcludeOtherLists />
</Web>

See Also

Concepts

SPMetal Default Code Generation Rules

Overriding SPMetal Defaults by Using a Parameters XML File