Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

AssociationAttribute class

Specifies that the property (mapped to a list field) has an association to another list, such as when the property is mapped to a lookup field.

System.Object
  System.Attribute
    Microsoft.SharePoint.Linq.DataAttribute
      Microsoft.SharePoint.Linq.AssociationAttribute

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

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

The following example shows the attribute used in the declaration of a property that represents a Lookup column to a Managers list.


[Association(Name="Manager", Storage="_manager", MultivalueType=AssociationType.Multi, List="Managers")]
public EntitySet<Item> Manager {
    get {
        return this._manager;
    }
    set {
        this._manager.Assign(value);
    }
}

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