ColumnAttribute 类
指定的属性将映射到的字段 (列) Microsoft SharePoint Foundation列表中。
继承层次结构
System.Object
System.Attribute
Microsoft.SharePoint.Linq.DataAttribute
Microsoft.SharePoint.Linq.ColumnAttribute
命名空间: Microsoft.SharePoint.Linq
程序集: Microsoft.SharePoint.Linq(位于 Microsoft.SharePoint.Linq.dll 中)
语法
声明
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple := False)> _
Public NotInheritable Class ColumnAttribute _
Inherits DataAttribute
用法
Dim instance As ColumnAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class ColumnAttribute : DataAttribute
备注
映射到的字段的每个属性必须具有此属性。.
示例
下面是类的用ColumnAttribute修饰的属性与一个内容类型的示例:
[ContentType(Name="Item", Id="0x01", List="Team Members")]
[DataContract()]
public partial class TeamMembersItem : Item {
private System.Nullable<double> _memberID;
public TeamMembersItem() {
this.Initialize();
}
[Column(Name="MemberID", Storage="_memberID", Required=true, FieldType="Number")]
[DataMember()]
public System.Nullable<double> MemberID {
get {
return this._memberID;
}
set {
if ((this._memberID != value)) {
this.OnPropertyChanging("MemberID", this._memberID);
this._memberID = value;
this.OnPropertyChanged("MemberID");
}
}
}
// Other members omitted for readability.
}
线程安全性
该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。