다음을 통해 공유


ExcludeOtherColumns (SPMetal)

Applies to: SharePoint Foundation 2010

Specifies that SPMetal should generate code only for columns that are explicitly represented by Column elements.

Web (SPMetal)
  ContentType (SPMetal)
    ExcludeOtherColumns (SPMetal)

<ExcludeOtherColumns />

Attributes and Elements

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

Attributes

None.

Child Elements

None.

Parent Elements

Element

Description

ContentType (SPMetal)

Specifies that a content type should be included in code generation and modifies which columns in the content type are included in code generation.

Remarks

A ContentType element cannot have both an ExcludeOtherColumns element and an IncludeHiddenColumns element.

Example

The following shows the ExcludeOtherColumns element in use. The presence of the element ensures that code generated for the Contact content type class has properties for only the three columns explicitly represented by Column elements.

<?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"/>
    <ExcludeOtherColumns />
  </ContentType>
  <ExcludeContentType Name="Order"/>
  <List Name="Team Members" Type="TeamMember">
    <ContentType Name="Item" Class=:TeamMember" />
  </List>
</Web>

See Also

Concepts

SPMetal Default Code Generation Rules

Overriding SPMetal Defaults by Using a Parameters XML File