[]
        
(Showing Draft Content)

C1.LiveLinq.LiveViews.Xml.XmlExtensions.IndexedAttribute

IndexedAttribute Method

IndexedAttribute(XElement, XName)

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

Declaration
public static XHint IndexedAttribute(this XElement element, XName name)
Parameters
Type Name Description
XElement element

The element containing the attribute.

XName name

The name of the attribute to get.

Returns
Type Description
XHint

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

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

IndexedAttribute(XAttribute)

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

Declaration
public static XHint IndexedAttribute(this XAttribute attribute)
Parameters
Type Name Description
XAttribute attribute

The attribute 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 attribute, 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.Attribute("CustomerID").IndexedAttribute() == "ALFKI"
    select c;

IndexedAttribute(XAttribute, IndexingHintAction)

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

Declaration
public static XHint IndexedAttribute(this XAttribute attribute, IndexingHintAction action)
Parameters
Type Name Description
XAttribute attribute

The attribute 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 attribute, 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.Attribute("CustomerID").IndexedAttribute(IndexingHintAction.Mandatory) == "ALFKI"
    select c;

IndexedAttribute(XElement, XName, IndexingHintAction)

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

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

The element containing the attribute.

XName name

The name of the attribute to get.

IndexingHintAction action

The action specified by the hint.

Returns
Type Description
XHint

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

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