共用方式為


ExcludeList (SPMetal)

Applies to: SharePoint Foundation 2010

Specifies that a list should be excluded from code generation.

Web (SPMetal)
  ExcludeList (SPMetal)

<ExcludeList Name="Calendar" />

Complex

Attributes and Elements

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

Attributes

Attribute

Description

Name

The name of the list that is excluded.

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 a List element and an ExcludeList element that name the same list.

Example

The following is an example of an ExcludeList element in use.

<?xml version="1.0" encoding="utf-8"?>
<Web AccessModifier="Internal" xmlns="https://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>
 <ExcludeList Name="Calendar" />
</Web>

See Also

Concepts

SPMetal Default Code Generation Rules

Overriding SPMetal Defaults by Using a Parameters XML File