ListAttribute Class

Specifies that a property of a DataContext object represents a Microsoft SharePoint Foundation list.

Inheritance Hierarchy


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


<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple := False)> _
Public NotInheritable Class ListAttribute _
    Inherits Attribute
Dim instance As ListAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class ListAttribute : Attribute


For example, the following shows a simplified declaration of a DataContext-derived class that has several properties that represent lists:

public partial class TeamSiteDataContext : DataContext 
    // ctors omitted for readability.
    public EntityList<Item> Projects 
        get {
            return this.GetList<Item>("Projects");
    public EntityList<Item> Managers 
        get {
            return this.GetList<Item>("Managers");
    [List(Name="Team Members")]
    public EntityList<Item> TeamMembers 
        get {
            return this.GetList<Item>("Team Members");

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


ListAttribute Members

Microsoft.SharePoint.Linq Namespace