Table of Contents

Class GraphNavigation

Namespace
The.Entities
Assembly
Instagile.dll

Provides methods for navigating and loading graphs of related entities.

public static class GraphNavigation
Inheritance
GraphNavigation
Inherited Members

Methods

CreatePathQuery(IEntity, RelationshipPath)

Composes a store query for the entities at the end of path from root without loading any reference along it; a new (unsaved) root yields no results.

public static IEntityQuery<IEntity> CreatePathQuery(IEntity root, RelationshipPath path)

Parameters

root IEntity
path RelationshipPath

Returns

IEntityQuery<IEntity>

CreatePathQuery<U>(IEntity, RelationshipPath)

Typed form of CreatePathQuery(IEntity, RelationshipPath) for paths whose destination is U.

public static IEntityQuery<U> CreatePathQuery<U>(IEntity root, RelationshipPath path) where U : IEntity

Parameters

root IEntity
path RelationshipPath

Returns

IEntityQuery<U>

Type Parameters

U

EnsureLoaded(IEnumerable<IEntity>, params RelationshipPath[])

Ensure that all specified relationship paths are loaded.

public static void EnsureLoaded(IEnumerable<IEntity> roots, params RelationshipPath[] paths)

Parameters

roots IEnumerable<IEntity>
paths RelationshipPath[]

Exceptions

InvalidGraphException

When a relationship in paths is not present.

EnsureLoaded<TTree>(IEnumerable<IEntity>, TTree)

Ensure that all relationships described by tree are loaded.

public static void EnsureLoaded<TTree>(IEnumerable<IEntity> roots, TTree tree) where TTree : IRelationshipTree<TTree>

Parameters

roots IEnumerable<IEntity>
tree TTree

Type Parameters

TTree

Exceptions

InvalidGraphException

When a relationship in tree is not present.

GetGraphLoadOperations(IEnumerable<IEntity>, params RelationshipPath[])

Generates the read operations required to load an arbitrarily complex graph of related entities.

public static List<ReadOperation> GetGraphLoadOperations(IEnumerable<IEntity> roots, params RelationshipPath[] paths)

Parameters

roots IEnumerable<IEntity>
paths RelationshipPath[]

Returns

List<ReadOperation>

GetGraphLoadOperations<TTree>(IEnumerable<IEntity>, TTree)

Generates the read operations required to load an arbitrarily complex graph of related entities.

public static List<ReadOperation> GetGraphLoadOperations<TTree>(IEnumerable<IEntity> roots, TTree tree) where TTree : IRelationshipTree<TTree>

Parameters

roots IEnumerable<IEntity>
tree TTree

Returns

List<ReadOperation>

Type Parameters

TTree

GetGraphLoadOperations<T>(IEntityQuery<T>, params RelationshipPath[])

Generates the read operations required to load an arbitrarily complex graph of entities.

public static List<ReadOperation> GetGraphLoadOperations<T>(IEntityQuery<T> baseQuery, params RelationshipPath[] paths) where T : IEntity

Parameters

baseQuery IEntityQuery<T>
paths RelationshipPath[]

Returns

List<ReadOperation>

Type Parameters

T

GetGraphLoadOperations<T>(IQueryable<T>, params RelationshipPath[])

Generates the read operations required to load an arbitrarily complex graph of entities.

public static List<ReadOperation> GetGraphLoadOperations<T>(IQueryable<T> baseQuery, params RelationshipPath[] paths) where T : IEntity

Parameters

baseQuery IQueryable<T>
paths RelationshipPath[]

Returns

List<ReadOperation>

Type Parameters

T

GetGraphLoadOperations<TEntity, TTree>(IEntityQuery<TEntity>, TTree)

Generates the read operations required to load an arbitrarily complex graph of entities.

public static List<ReadOperation> GetGraphLoadOperations<TEntity, TTree>(IEntityQuery<TEntity> baseQuery, TTree tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

baseQuery IEntityQuery<TEntity>
tree TTree

Returns

List<ReadOperation>

Type Parameters

TEntity
TTree

GetGraphLoadOperations<TEntity, TTree>(IQueryable<TEntity>, TTree)

Generates the read operations required to load an arbitrarily complex graph of entities.

public static List<ReadOperation> GetGraphLoadOperations<TEntity, TTree>(IQueryable<TEntity> baseQuery, TTree tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

baseQuery IQueryable<TEntity>
tree TTree

Returns

List<ReadOperation>

Type Parameters

TEntity
TTree

GetReachableEntities(IEnumerable<IEntity>)

public static IEnumerable<EntityKernel> GetReachableEntities(IEnumerable<IEntity> roots)

Parameters

roots IEnumerable<IEntity>

Returns

IEnumerable<EntityKernel>

GetReachableEntities(EntityKernel)

public static IEnumerable<EntityKernel> GetReachableEntities(EntityKernel root)

Parameters

root EntityKernel

Returns

IEnumerable<EntityKernel>

LoadGraphAsync(IEnumerable<IEntity>, CancellationToken?, params RelationshipPath[])

Loads an arbitrarily complex graph of related entities in one call to ReadAsync, or zero if all paths are already loaded.

public static Task LoadGraphAsync(IEnumerable<IEntity> roots, CancellationToken? cancellationToken, params RelationshipPath[] paths)

Parameters

roots IEnumerable<IEntity>
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task

LoadGraphAsync(IEntity, CancellationToken?, params RelationshipPath[])

Loads an arbitrarily complex graph of related entities in one call to ReadAsync, or zero if all paths are already loaded.

public static Task LoadGraphAsync(IEntity root, CancellationToken? cancellationToken, params RelationshipPath[] paths)

Parameters

root IEntity
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task

LoadGraphAsync(IEntity, params RelationshipPath[])

Loads an arbitrarily complex graph of related entities in one call to ReadAsync, or zero if all paths are already loaded.

public static Task LoadGraphAsync(IEntity root, params RelationshipPath[] paths)

Parameters

root IEntity
paths RelationshipPath[]

Returns

Task

LoadGraphAsync<TTree>(IEnumerable<IEntity>, CancellationToken?, TTree)

Loads an arbitrarily complex graph of related entities in one call to ReadAsync, or zero if all paths are already loaded.

public static Task LoadGraphAsync<TTree>(IEnumerable<IEntity> roots, CancellationToken? cancellationToken, TTree tree) where TTree : IRelationshipTree<TTree>

Parameters

roots IEnumerable<IEntity>
cancellationToken CancellationToken?
tree TTree

Returns

Task

Type Parameters

TTree

LoadGraphAsync<TTree>(IEntity, CancellationToken?, TTree)

Loads an arbitrarily complex graph of related entities in one call to ReadAsync, or zero if all paths are already loaded.

public static Task LoadGraphAsync<TTree>(IEntity root, CancellationToken? cancellationToken, TTree tree) where TTree : IRelationshipTree<TTree>

Parameters

root IEntity
cancellationToken CancellationToken?
tree TTree

Returns

Task

Type Parameters

TTree

LoadGraphAsync<TTree>(IEntity, TTree)

Loads an arbitrarily complex graph of related entities in one call to ReadAsync, or zero if all paths are already loaded.

public static Task LoadGraphAsync<TTree>(IEntity root, TTree tree) where TTree : IRelationshipTree<TTree>

Parameters

root IEntity
tree TTree

Returns

Task

Type Parameters

TTree

LoadPathAsync(IEntity, RelationshipPath, CancellationToken?)

Loads a path of references from root in at most one read batch and returns the entity at its end, or null if a reference along the path is null.

public static Task<IEntity?> LoadPathAsync(IEntity root, RelationshipPath path, CancellationToken? cancellationToken = null)

Parameters

root IEntity
path RelationshipPath
cancellationToken CancellationToken?

Returns

Task<IEntity>

TryGetLoaded(IEntity, RelationshipPath, out IEntity?)

Walks an already-loaded path of references from root without I/O: false if any reference along the path is unloaded, true with a null leaf if one is null.

public static bool TryGetLoaded(IEntity root, RelationshipPath path, out IEntity? leaf)

Parameters

root IEntity
path RelationshipPath
leaf IEntity

Returns

bool