Partager via


Classe QueryByAttribute

S'applique à: CRM 2015 on-prem, CRM Online

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

Espace de noms: Microsoft.Xrm.Sdk.Query
Assembly: Microsoft.Xrm.Sdk (dans Microsoft.Xrm.Sdk.dll)

Syntaxe

'Déclaration
<DataContractAttribute(Name:="QueryByAttribute", Namespace:="https://schemas.microsoft.com/xrm/2011/Contracts")> _
<SuppressMessageAttribute("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification:="Suffix is correct")> _
Public NotInheritable Class QueryByAttribute
    Inherits QueryBase
[DataContractAttribute(Name="QueryByAttribute", Namespace="https://schemas.microsoft.com/xrm/2011/Contracts")] 
[SuppressMessageAttribute("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification="Suffix is correct")] 
public sealed class QueryByAttribute : QueryBase

Exemple

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

Hiérarchie d'héritage

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

Cohérence de thread

Tous les membres statiques publics (Shared dans Visual Basic) de ce type sont thread-safe. Tous les membres d'instance ne sont pas garantis thread-safe.

Plateformes

Plateformes de développement

Windows Vista, Windows Server 2003 et

Plateformes cibles

Windows Vista,Windows XP

Change History

Voir aussi

Référence

Membres QueryByAttribute
Espace de noms Microsoft.Xrm.Sdk.Query

Autres ressources

Build Queries with QueryExpression
Sample: Retrieve Multiple with Query By Attribute

Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.