Share via


QueryByAttribute Class

Definition

Contains a query that is expressed as a set of attribute and value pairs.

public ref class QueryByAttribute sealed : Microsoft::Xrm::Sdk::Query::QueryBase
[System.Runtime.Serialization.DataContract(Name="QueryByAttribute", Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class QueryByAttribute : Microsoft.Xrm.Sdk.Query.QueryBase
[<System.Runtime.Serialization.DataContract(Name="QueryByAttribute", Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")>]
type QueryByAttribute = class
    inherit QueryBase
Public NotInheritable Class QueryByAttribute
Inherits QueryBase
Inheritance
QueryByAttribute
Attributes

Examples

//  Create query using QueryByAttribute.
QueryByAttribute querybyattribute = new QueryByAttribute("account") {
   ColumnSet = new ColumnSet("name", "address1_city", "emailaddress1"),
   Attributes.AddRange("address1_city"),
   Values.AddRange("Redmond")
};


Constructors

QueryByAttribute()

Initializes a new instance of the QueryByAttribute class.

QueryByAttribute(String)

Initializes a new instance of the QueryByAttribute class.

Properties

Attributes

Gets the set of attributes selected in the query.

ColumnSet

Gets or sets the column set.

EntityName

Gets or sets the logical name of the entity to query.

ExtensionData

Gets or sets the structure that contains extra data.

(Inherited from QueryBase)
Orders

Gets the order in which the entity instances are returned from the query.

PageInfo

Gets or sets the number of pages and the number of entity instances per page returned from the query.

TopCount

Gets or sets the number of rows to be returned.

Values

Gets the attribute values to look for when the query is executed.

Methods

AddAttributeValue(String, Object)

Adds an attribute value to the attributes collection.

AddOrder(String, OrderType)

Adds an order to the orders collection.

Applies to