EntityReferenceMapper
- Namespace:
PPDS.Migration.Import - Assembly:
PPDS.Migration - Kind: Class
Summary
Resolves entity references using cascading lookup resolution.
Members
Constructors
EntityReferenceMapper(IdMappingCollection idMappings, IDataverseConnectionPool pool, ImportOptions options, ILogger<EntityReferenceMapper> logger)
EntityReferenceMapper(IdMappingCollection idMappings, IDataverseConnectionPool pool, ImportOptions options, ILogger<EntityReferenceMapper> logger)
Initializes a new instance of the PPDS.Migration.Import.EntityReferenceMapper class.
-
Param
idMappings: The ID mapping collection. -
Param
pool: The connection pool. -
Param
options: The import options. -
Param
logger: Optional logger.
Methods
GetMatchField
string GetMatchField(string entityName)
Gets the match field for name-based resolution.
-
Param
entityName: The entity logical name. -
Returns: The match field name, or null if no match field is known. Full implementation would require entity metadata lookup for primary name attribute.
ResolveAsync
Task<Nullable<Guid>> ResolveAsync(string targetEntityName, Guid sourceId, CancellationToken cancellationToken)
Resolves a source entity reference to its target GUID.
-
Param
targetEntityName: The target entity logical name. -
Param
sourceId: The source record GUID. -
Param
cancellationToken: Cancellation token. -
Returns: The resolved target GUID, or null if unresolved.
ResolveWithNameAsync
Task<Nullable<Guid>> ResolveWithNameAsync(string targetEntityName, Guid sourceId, string nameValue, CancellationToken cancellationToken)
Resolves a lookup with name-based fallback.
-
Param
targetEntityName: The target entity logical name. -
Param
sourceId: The source record GUID. -
Param
nameValue: The name value for name-based resolution. -
Param
cancellationToken: Cancellation token. -
Returns: The resolved target GUID, or null if unresolved.