QueryByAttribute Class
Applies To: Dynamics CRM 2015
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)
Inheritance Hierarchy
System.Object
Microsoft.Xrm.Sdk.Query.QueryBase
Microsoft.Xrm.Sdk.Query.QueryByAttribute
Syntax
[DataContractAttribute(Name = "QueryByAttribute", Namespace = "https://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class QueryByAttribute : QueryBase
[DataContractAttribute(Name = "QueryByAttribute", Namespace = "https://schemas.microsoft.com/xrm/2011/Contracts")]
public ref class QueryByAttribute sealed : QueryBase
[<Sealed>]
[<DataContractAttribute(Name = "QueryByAttribute", Namespace = "https://schemas.microsoft.com/xrm/2011/Contracts")>]
type QueryByAttribute =
class
inherit QueryBase
end
<DataContractAttribute(Name := "QueryByAttribute", Namespace := "https://schemas.microsoft.com/xrm/2011/Contracts")>
Public NotInheritable Class QueryByAttribute
Inherits QueryBase
Constructors
Name | Description | |
---|---|---|
QueryByAttribute() | Initializes a new instance of the QueryByAttribute class. |
|
QueryByAttribute(String) | Initializes a new instance of the QueryByAttribute class. |
Properties
Name | Description | |
---|---|---|
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
Name | Description | |
---|---|---|
AddAttributeValue(String, Object) | Adds an attribute value to the attributes collection. |
|
AddOrder(String, OrderType) | Adds an order to the orders collection. |
|
Equals(Object) | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
ToString() | (Inherited from Object.) |
Examples
// Create query using QueryByAttribute.
QueryByAttribute querybyattribute = new QueryByAttribute("account") {
ColumnSet = new ColumnSet("name", "address1_city", "emailaddress1"),
Attributes.AddRange("address1_city"),
Values.AddRange("Redmond")
};
Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.Xrm.Sdk.Query Namespace
Build queries with QueryExpression
Sample: Retrieve multiple with the QueryByAttribute class
Return to top
© 2016 Microsoft. All rights reserved. Copyright