[]
        
(Showing Draft Content)

C1.LiveLinq.LiveViews.Xml.XmlExtensions.IndexedElement

IndexedElement Method

IndexedElement(XContainer, XName)

A hint to create and use an index on the specified XML element. The hint has default action.

Declaration
public static XHint IndexedElement(this XContainer container, XName name)
Parameters
Type Name Description
XContainer container

The element or document containing the element.

XName name

The name of the element to get.

Returns
Type Description
XHint

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 Element(XName). See Hints for more details.

Examples
var query =
    from c in customers
    where (string)c.IndexedElement("CustomerID") == "ALFKI"
    select c;

IndexedElement(XElement)

A hint to create and use an index on the specified XML element. The hint has default action.

Declaration
public static XHint IndexedElement(this XElement element)
Parameters
Type Name Description
XElement element

The element to apply the hint to.

Returns
Type Description
XHint

Formally, the hint returns the same value that it receives in the parameter. In fact, it is never executed, its role is purely declarative.

Remarks

Hints are used declaratively. They tell LiveLinq query optimizer to create and use an index on this element, if possible. After it is used for query optimization, before the query is executed, this hint is removed from the expression. See Hints for more details.

Examples
var query =
    from c in customers
    where (string)c.Element("CustomerID").IndexedElement() == "ALFKI"
    select c;

IndexedElement(XElement, IndexingHintAction)

A hint to create and use an index on the specified XML element. The hint has specified action.

Declaration
public static XHint IndexedElement(this XElement element, IndexingHintAction action)
Parameters
Type Name Description
XElement element

The element to apply the hint to.

IndexingHintAction action

The action specified by the hint.

Returns
Type Description
XHint

Formally, the hint returns the same value that it receives in the parameter. In fact, it is never executed, its role is purely declarative.

Remarks

Hints are used declaratively. They tell LiveLinq query optimizer to create and use an index on this element, if possible. After it is used for query optimization, before the query is executed, this hint is removed from the expression. See Hints for more details.

Examples
var query =
    from c in customers
    where (string)c.Element("CustomerID").IndexedElement(IndexingHintAction.Mandatory) == "ALFKI"
    select c;

IndexedElement(XContainer, XName, IndexingHintAction)

A hint to create and use an index on the specified XML element. The hint has specified action.

Declaration
public static XHint IndexedElement(this XContainer container, XName name, IndexingHintAction action)
Parameters
Type Name Description
XContainer container

The element or document containing the element.

XName name

The name of the element to get.

IndexingHintAction action

The action specified by the hint.

Returns
Type Description
XHint

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 Element(XName). See Hints for more details.

Examples
var query =
    from c in customers
    where (string)c.IndexedElement("CustomerID", IndexingHintAction.Mandatory) == "ALFKI"
    select c;