ExcludeColumn 元素 (SPMetal)
适用于: SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013
指定生成 SPMetal 代码时不包括列。
<ExcludeColumn Name="HomeTelephone" />
元素和属性
下面各部分介绍了属性、子元素和父元素。
Attributes
属性 | 说明 |
---|---|
名称 |
生成代码时排除的内容类型中的列的名称。 |
子元素
无。
父元素
元素 | 说明 |
---|---|
ContentType |
指定应在代码生成中包含内容类型,并修改代码生成中包含内容类型中的哪些列。 |
备注
ContentType 元素不能同时具有 Column 元素和为同一列命名的 ExcludeColumn 元素。 命名隐藏列的 ExcludeColumn 元素可能不存在于具有 IncludeHiddenColumns 元素的同一 ContentType 元素中。
示例
下面显示了正在使用的 ExcludeColumn 元素。
<?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" Type="TeamMember">
<ContentType Name="Item" Class="TeamMember" />
</List>
</Web>