Export (0) Print
Expand All

LookupList<T> class

Represents the values of a Microsoft SharePoint Foundation lookup field (column) that allows multiple values.

System.Object
  Microsoft.SharePoint.Linq.LookupList<T>

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

[DataContractAttribute]
public sealed class LookupList<T> : IList<T>, 
	ICollection<T>, IEnumerable<T>, IEnumerable, ICloneable

Type parameters

T

The type of the members of the LookupList<T>.

T is the .Net type of the values in the target field from which values are drawn. SharePoint Foundation types are mapped to .Net types as described in the article SharePoint to .Net Type Mapping.

A LookupList<T> object is typically a private field in a content type class that is wrapped with a public property of type IList<T>.

The following example shows a declaration of a LookupList<T> field and the IList<T> property that wraps it. These declarations extend the example in the topic EntitySet<TEntity>. The scenario is as follows: A Team Members list has an Assigned Projects column that is a lookup field to a Projects list. More than one team member can be assigned to a particular.


ContentType(Name="Item", Id="0x01", List="Team Members")]
[DataContract()]
public partial class TeamMembersItem : Item {

    [DataMember()]
    private LookupList<String> _assignedProjectsTitles;

    [Column(Name="AssignedProjects", Storage="_assignedProjectsTitles", FieldType="Lookup", IsLookupValue=true, LookupDisplayColumn="Title")]
    public IList<String> AssignedProjectsTitles {
        get {
           return this._assignedProjectsTitles;
        }
        set {
            this._assignedProjectsTitles.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