Export (0) Print
Expand All

ColumnAttribute Class

Specifies that the property is mapped to a field (column) in a Microsoft SharePoint Foundation list.


Namespace:  Microsoft.SharePoint.Linq
Assembly:  Microsoft.SharePoint.Linq (in Microsoft.SharePoint.Linq.dll)

[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class ColumnAttribute : DataAttribute

Every property that is mapped to a field must have this attribute..

The following is an example of a content type class with a property that is decorated with the ColumnAttribute:

[ContentType(Name="Item", Id="0x01", List="Team Members")]
public partial class TeamMembersItem : Item {
    private System.Nullable<double> _memberID;
    public TeamMembersItem() {

    [Column(Name="MemberID", Storage="_memberID", Required=true, FieldType="Number")]
    public System.Nullable<double> MemberID {
        get {
            return this._memberID;
        set {
            if ((this._memberID != value)) {
                this.OnPropertyChanging("MemberID", this._memberID);
                this._memberID = value;

    // Other members omitted for readability.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2014 Microsoft