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

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

    Parameters

    container
    The element or document containing the element.
    name
    The name of the element to get.

    Return Value

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