ComponentOne Data Source for Entity Framework
C1.LiveLinq.LiveViews.Xml Namespace / XmlExtensions Class / IndexedAttribute Method / IndexedAttribute(XElement,XName) Method
The element containing the attribute.
The name of the attribute to get.
Example

In This Topic
    IndexedAttribute(XElement,XName) Method
    In This Topic
    A hint to create and use an index on the specified XML attribute. The hint has default action.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function IndexedAttribute( _
       ByVal element As System.Xml.Linq.XElement, _
       ByVal name As System.Xml.Linq.XName _
    ) As XHint
    public static XHint IndexedAttribute( 
       System.Xml.Linq.XElement element,
       System.Xml.Linq.XName name
    )

    Parameters

    element
    The element containing the attribute.
    name
    The name of the attribute to get.

    Return Value

    The attribute that has the specified name.
    Remarks
    Hints are used declaratively. They tell LiveLinq query optimizer to create and use an index on this attribute, if possible. When the query is executed, the hint method IndexedAttribute is replaced with the standard LINQ to XML method System.Xml.Linq.XElement.Attribute(System.Xml.Linq.XName). See C1.LiveLinq.Hints for more details.
    Example
    var query =
        from c in customers
        where (string)c.IndexedAttribute("CustomerID") == "ALFKI"
        select c;
    See Also