Skip to main content

IMetadataQueryService

  • Namespace: PPDS.Dataverse.Metadata
  • Assembly: PPDS.Dataverse
  • Kind: Interface

Summary

Provides access to Dataverse metadata for entity browsing and discovery.

Members

Methods

GetAttributesAsync

Task<IReadOnlyList<AttributeMetadataDto>> GetAttributesAsync(string entityLogicalName, string attributeType, CancellationToken cancellationToken)

Gets all attributes for an entity.

  • Param entityLogicalName: The entity logical name.

  • Param attributeType: Optional filter by attribute type (e.g., "Lookup", "String").

  • Param cancellationToken: Cancellation token.

  • Returns: List of attribute metadata.

GetEntitiesAsync

Task<IReadOnlyList<EntitySummary>> GetEntitiesAsync(bool customOnly, string filter, bool includeIntersect, CancellationToken cancellationToken)

Gets a list of all entities with basic information.

  • Param customOnly: If true, only return custom entities.

  • Param filter: Optional filter pattern to match entity logical names (supports * wildcard).

  • Param includeIntersect: If true, include intersection entities (default: false).

  • Param cancellationToken: Cancellation token.

  • Returns: List of entity summaries.

GetEntityAsync

Task<EntityMetadataDto> GetEntityAsync(string logicalName, bool includeAttributes, bool includeRelationships, bool includeKeys, bool includePrivileges, CancellationToken cancellationToken)

Gets full metadata for a specific entity including attributes, relationships, keys, and privileges.

  • Param logicalName: The entity logical name.

  • Param includeAttributes: Include attributes in the response.

  • Param includeRelationships: Include relationships in the response.

  • Param includeKeys: Include alternate keys in the response.

  • Param includePrivileges: Include privileges in the response.

  • Param cancellationToken: Cancellation token.

  • Returns: Full entity metadata.

GetEntityWithGlobalOptionSetsAsync

Task<ValueTuple<EntityMetadataDto, IReadOnlyList<OptionSetMetadataDto>>> GetEntityWithGlobalOptionSetsAsync(string logicalName, bool includeGlobalOptionSets, CancellationToken cancellationToken)

Gets full metadata for a specific entity, optionally including global option set values for picklist attributes.

GetGlobalOptionSetsAsync

Task<IReadOnlyList<OptionSetSummary>> GetGlobalOptionSetsAsync(string filter, CancellationToken cancellationToken)

Gets all global option sets.

  • Param filter: Optional filter pattern to match option set names (supports * wildcard).

  • Param cancellationToken: Cancellation token.

  • Returns: List of option set summaries.

GetKeysAsync

Task<IReadOnlyList<EntityKeyDto>> GetKeysAsync(string entityLogicalName, CancellationToken cancellationToken)

Gets all alternate keys for an entity.

  • Param entityLogicalName: The entity logical name.

  • Param cancellationToken: Cancellation token.

  • Returns: List of entity key metadata.

GetOptionSetAsync

Task<OptionSetMetadataDto> GetOptionSetAsync(string name, CancellationToken cancellationToken)

Gets a specific global option set with all values.

  • Param name: The option set name.

  • Param cancellationToken: Cancellation token.

  • Returns: Full option set metadata with values.

GetRelationshipsAsync

Task<EntityRelationshipsDto> GetRelationshipsAsync(string entityLogicalName, string relationshipType, CancellationToken cancellationToken)

Gets all relationships for an entity.

  • Param entityLogicalName: The entity logical name.

  • Param relationshipType: Optional filter by type (OneToMany, ManyToOne, ManyToMany).

  • Param cancellationToken: Cancellation token.

  • Returns: Entity relationships grouped by type.