Classe EntityQueryExpression
S'applique à: CRM 2015 on-prem, CRM Online
Defines a complex query to retrieve entity metadata.
Espace de noms: Microsoft.Xrm.Sdk.Metadata.Query
Assembly: Microsoft.Xrm.Sdk (dans Microsoft.Xrm.Sdk.dll)
Syntaxe
'Déclaration
<DataContractAttribute(Name:="EntityQueryExpression", Namespace:="https://schemas.microsoft.com/xrm/2011/Metadata/Query")> _
Public NotInheritable Class EntityQueryExpression
Inherits MetadataQueryExpression
[DataContractAttribute(Name="EntityQueryExpression", Namespace="https://schemas.microsoft.com/xrm/2011/Metadata/Query")]
public sealed class EntityQueryExpression : MetadataQueryExpression
Remarques
The following example shows the use of an EntityQueryExpression to retrieve entity metadata.
//An entity query expression to combine the filter expressions and property expressions for the query.
EntityQueryExpression entityQueryExpression = new EntityQueryExpression()
{
Criteria = EntityFilter,
Properties = EntityProperties,
AttributeQuery = new AttributeQueryExpression()
{
Criteria = AttributeFilter,
Properties = AttributeProperties
},
LabelQuery = labelQuery
};
//Retrieve the metadata for the query without a ClientVersionStamp
RetrieveMetadataChangesResponse initialRequest = getMetadataChanges(entityQueryExpression, null, DeletedMetadataFilters.OptionSet);
...
protected RetrieveMetadataChangesResponse getMetadataChanges(
EntityQueryExpression entityQueryExpression,
String clientVersionStamp,
DeletedMetadataFilters deletedMetadataFilter)
{
RetrieveMetadataChangesRequest retrieveMetadataChangesRequest = new RetrieveMetadataChangesRequest()
{
Query = entityQueryExpression,
ClientVersionStamp = clientVersionStamp,
DeletedMetadataFilters = deletedMetadataFilter
};
return (RetrieveMetadataChangesResponse)_service.Execute(retrieveMetadataChangesRequest);
}
Hiérarchie d'héritage
System.Object
Microsoft.Xrm.Sdk.Metadata.Query.MetadataQueryBase
Microsoft.Xrm.Sdk.Metadata.Query.MetadataQueryExpression
Microsoft.Xrm.Sdk.Metadata.Query.EntityQueryExpression
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 98,Windows 2000,Windows 2000 Server,Windows CE,Windows Server 2008,Windows 98 Deuxième Édition,Pocket PC,Smart Phone,Windows Server 2003,Windows XP Professionnel,Windows Vista,Windows XP
Change History
Voir aussi
Référence
Membres EntityQueryExpression
Espace de noms Microsoft.Xrm.Sdk.Metadata.Query
Autres ressources
Query and Capture Changes to Metadata
Sample: Query Metadata and Detect Changes
Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.