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

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