QueryByAttribute Class

 

Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

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

Namespace:   Microsoft.Xrm.Sdk.Query
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)

System.Object
  Microsoft.Xrm.Sdk.Query.QueryBase
    Microsoft.Xrm.Sdk.Query.QueryByAttribute

[DataContractAttribute(Name = "QueryByAttribute", Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class QueryByAttribute : QueryBase

NameDescription
System_CAPS_pubmethodQueryByAttribute()

Initializes a new instance of the QueryByAttribute class.

System_CAPS_pubmethodQueryByAttribute(String)

Initializes a new instance of the QueryByAttribute class.

NameDescription
System_CAPS_pubpropertyAttributes

Gets the set of attributes selected in the query.

System_CAPS_pubpropertyColumnSet

Gets or sets the column set.

System_CAPS_pubpropertyEntityName

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

System_CAPS_pubpropertyExtensionData

Gets or sets the structure that contains extra data.(Inherited from QueryBase.)

System_CAPS_pubpropertyOrders

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

System_CAPS_pubpropertyPageInfo

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

System_CAPS_pubpropertyTopCount

Gets or sets the number of rows to be returned.

System_CAPS_pubpropertyValues

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

NameDescription
System_CAPS_pubmethodAddAttributeValue(String, Object)

Adds an attribute value to the attributes collection.

System_CAPS_pubmethodAddOrder(String, OrderType)

Adds an order to the orders collection.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)


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



Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

ADD
Show: