Class PathExtractor
public static class PathExtractor
- Inheritance
-
PathExtractor
- Inherited Members
Methods
BuildQueryExpression(IEntityInfo, Guid, RelationshipPath)
Builds a synthetic include expression for a specific entity ID.
public static Expression BuildQueryExpression(IEntityInfo sourceMetadata, Guid sourceID, RelationshipPath includePath)
Parameters
sourceMetadataIEntityInfoMetadata for the main entity type
sourceIDGuidThe specific entity ID to filter by
includePathRelationshipPathThe relationship path to follow
Returns
BuildRelationshipExpression(Expression, RelationshipPath)
Builds Select/SelectMany expression chain for a relationship path.
public static Expression BuildRelationshipExpression(Expression sourceExpression, RelationshipPath relationshipPath)
Parameters
sourceExpressionExpressionBase query expression to build upon
relationshipPathRelationshipPathPath to traverse
Returns
- Expression
Expression with Select/SelectMany calls appended
ExtractRelationshipPath(LambdaExpression)
Extracts a RelationshipPath from a lambda expression supporting multi-level navigation. Examples: x => x.Enemy, x => x.Enemy.BestFriend, x => x.Enemy.BestFriend.Owns
public static RelationshipPath ExtractRelationshipPath(LambdaExpression selector)
Parameters
selectorLambdaExpression
Returns
TryExtractPropertyName(LambdaExpression, out string?)
Extracts a property name from a simple property access lambda expression. Example: x => x.Name -> "Name"
public static bool TryExtractPropertyName(LambdaExpression selector, out string? propertyName)
Parameters
selectorLambdaExpressionLambda expression accessing a single property
propertyNamestringProperty name
Returns
- bool
Whether a name could be extracted