LookupList<T> Class

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

Inheritance Hierarchy

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

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

Syntax

'Declaration
<DataContractAttribute> _
Public NotInheritable Class LookupList(Of T) _
    Implements IList(Of T), ICollection(Of T),  _
    IEnumerable(Of T), IEnumerable, ICloneable
'Usage
Dim instance As LookupList(Of T)
[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>.

Remarks

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 Type Mapping: From LINQ to SharePoint Provider to .NET.

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>.

Examples

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);
        }
    }
}

Thread Safety

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

See Also

Reference

LookupList<T> Members

Microsoft.SharePoint.Linq Namespace