Table of Contents

Class QueryBatch

Namespace
The.Entities
Assembly
Instagile.dll

Provides a way to load multiple graphs of entities in one call to ReadAsync(IEntityContext, CancellationToken?, params ReadOperation[]) with type safety.

public sealed class QueryBatch
Inheritance
QueryBatch
Inherited Members

Constructors

QueryBatch()

public QueryBatch()

QueryBatch(bool)

Provides a way to load multiple graphs of entities in one call to ReadAsync(IEntityContext, CancellationToken?, params ReadOperation[]) with type safety.

public QueryBatch(bool deferErrors = false)

Parameters

deferErrors bool

Defer errors from operations like Single(), which allows for LoadAsync(IEntityContext, CancellationToken?) to succeed even if some queries ultimately fail when evalutating Value.

Properties

DeferErrors

public bool DeferErrors { get; }

Property Value

bool

Methods

AddCollection<T>(IEntitySet<T>, params RelationshipPath[])

public QueryBatch.Result<ILoadedSet<T>> AddCollection<T>(IEntitySet<T> collection, params RelationshipPath[] paths) where T : IEntity

Parameters

collection IEntitySet<T>
paths RelationshipPath[]

Returns

QueryBatch.Result<ILoadedSet<T>>

Type Parameters

T

AddCollection<TEntity, TTree>(IEntitySet<TEntity>, TTree)

public QueryBatch.Result<ILoadedSet<TEntity>> AddCollection<TEntity, TTree>(IEntitySet<TEntity> collection, TTree tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

collection IEntitySet<TEntity>
tree TTree

Returns

QueryBatch.Result<ILoadedSet<TEntity>>

Type Parameters

TEntity
TTree

AddGetByID(IEntityInfo, IEntityContext, Guid, params RelationshipPath[])

public QueryBatch.Result<IEntity> AddGetByID(IEntityInfo info, IEntityContext context, Guid ID, params RelationshipPath[] paths)

Parameters

info IEntityInfo
context IEntityContext
ID Guid
paths RelationshipPath[]

Returns

QueryBatch.Result<IEntity>

AddGetByIDOrDefault(IEntityInfo, IEntityContext, Guid?, params RelationshipPath[])

public QueryBatch.Result<IEntity?> AddGetByIDOrDefault(IEntityInfo info, IEntityContext context, Guid? ID, params RelationshipPath[] paths)

Parameters

info IEntityInfo
context IEntityContext
ID Guid?
paths RelationshipPath[]

Returns

QueryBatch.Result<IEntity>

AddGetByIDOrDefault<T>(IEntityContext, Guid?, params RelationshipPath[])

public QueryBatch.Result<T?> AddGetByIDOrDefault<T>(IEntityContext context, Guid? ID, params RelationshipPath[] paths) where T : IEntity<T>

Parameters

context IEntityContext
ID Guid?
paths RelationshipPath[]

Returns

QueryBatch.Result<T>

Type Parameters

T

AddGetByID<T>(IEntityContext, Guid, params RelationshipPath[])

public QueryBatch.Result<T> AddGetByID<T>(IEntityContext context, Guid ID, params RelationshipPath[] paths) where T : IEntity<T>

Parameters

context IEntityContext
ID Guid
paths RelationshipPath[]

Returns

QueryBatch.Result<T>

Type Parameters

T

AddGraph<T>(IEnumerable<T>, params RelationshipPath[])

public void AddGraph<T>(IEnumerable<T> roots, params RelationshipPath[] paths) where T : IEntity

Parameters

roots IEnumerable<T>
paths RelationshipPath[]

Type Parameters

T

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

public QueryBatch.ResultGenerator<T, RelationshipTree> AddGraph<T>(IEntityQuery<T> query, params RelationshipPath[] paths) where T : IEntity

Parameters

query IEntityQuery<T>
paths RelationshipPath[]

Returns

QueryBatch.ResultGenerator<T, RelationshipTree>

Type Parameters

T

AddGraph<T>(T, params RelationshipPath[])

public void AddGraph<T>(T root, params RelationshipPath[] paths) where T : IEntity

Parameters

root T
paths RelationshipPath[]

Type Parameters

T

AddGraph<TEntity, TTree>(IEnumerable<TEntity>, TTree?)

public void AddGraph<TEntity, TTree>(IEnumerable<TEntity> roots, TTree? tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

roots IEnumerable<TEntity>
tree TTree

Type Parameters

TEntity
TTree

AddGraph<TEntity, TTree>(IEntityQuery<TEntity>, TTree?)

public QueryBatch.ResultGenerator<TEntity, TTree> AddGraph<TEntity, TTree>(IEntityQuery<TEntity> query, TTree? tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

query IEntityQuery<TEntity>
tree TTree

Returns

QueryBatch.ResultGenerator<TEntity, TTree>

Type Parameters

TEntity
TTree

AddGraph<TEntity, TTree>(TEntity, TTree?)

public void AddGraph<TEntity, TTree>(TEntity root, TTree? tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

root TEntity
tree TTree

Type Parameters

TEntity
TTree

AddQuery<T>(IEntityQuery<T>)

public QueryBatch.ResultGenerator<T, RelationshipTree> AddQuery<T>(IEntityQuery<T> query)

Parameters

query IEntityQuery<T>

Returns

QueryBatch.ResultGenerator<T, RelationshipTree>

Type Parameters

T

AddReference<T>(EntityReferenceProperty<T>, params RelationshipPath[])

public QueryBatch.Result<T?> AddReference<T>(EntityReferenceProperty<T> reference, params RelationshipPath[] paths) where T : IEntity<T>

Parameters

reference EntityReferenceProperty<T>
paths RelationshipPath[]

Returns

QueryBatch.Result<T>

Type Parameters

T

AddReference<TEntity, TTree>(EntityReferenceProperty<TEntity>, TTree)

public QueryBatch.Result<TEntity?> AddReference<TEntity, TTree>(EntityReferenceProperty<TEntity> reference, TTree tree) where TEntity : IEntity<TEntity> where TTree : IRelationshipTree<TTree>

Parameters

reference EntityReferenceProperty<TEntity>
tree TTree

Returns

QueryBatch.Result<TEntity>

Type Parameters

TEntity
TTree

GetByIDAsync(IEntityInfo, IEntityContext, Guid, CancellationToken?, params RelationshipPath[])

public static Task<IEntity> GetByIDAsync(IEntityInfo info, IEntityContext context, Guid ID, CancellationToken? cancellationToken = null, params RelationshipPath[] paths)

Parameters

info IEntityInfo
context IEntityContext
ID Guid
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task<IEntity>

GetByIDAsync<T>(IEntityContext, Guid, CancellationToken?, params RelationshipPath[])

public static Task<T> GetByIDAsync<T>(IEntityContext context, Guid ID, CancellationToken? cancellationToken = null, params RelationshipPath[] paths) where T : IEntity<T>

Parameters

context IEntityContext
ID Guid
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task<T>

Type Parameters

T

GetByIDOrDefaultAsync(IEntityInfo, IEntityContext, Guid?, CancellationToken?, params RelationshipPath[])

public static Task<IEntity?> GetByIDOrDefaultAsync(IEntityInfo info, IEntityContext context, Guid? ID, CancellationToken? cancellationToken = null, params RelationshipPath[] paths)

Parameters

info IEntityInfo
context IEntityContext
ID Guid?
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task<IEntity>

GetByIDOrDefaultAsync<T>(IEntityContext, Guid?, CancellationToken?, params RelationshipPath[])

public static Task<T?> GetByIDOrDefaultAsync<T>(IEntityContext context, Guid? ID, CancellationToken? cancellationToken = null, params RelationshipPath[] paths) where T : IEntity<T>

Parameters

context IEntityContext
ID Guid?
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task<T>

Type Parameters

T

GetCollectionAsync<T>(IEntitySet<T>, CancellationToken?, params RelationshipPath[])

public static Task<ILoadedSet<T>> GetCollectionAsync<T>(IEntitySet<T> collection, CancellationToken? cancellationToken = null, params RelationshipPath[] paths) where T : IEntity

Parameters

collection IEntitySet<T>
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task<ILoadedSet<T>>

Type Parameters

T

GetCollectionAsync<TEntity, TTree>(IEntitySet<TEntity>, TTree, CancellationToken?)

public static Task<ILoadedSet<TEntity>> GetCollectionAsync<TEntity, TTree>(IEntitySet<TEntity> collection, TTree tree, CancellationToken? cancellationToken = null) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

collection IEntitySet<TEntity>
tree TTree
cancellationToken CancellationToken?

Returns

Task<ILoadedSet<TEntity>>

Type Parameters

TEntity
TTree

GetGraph<T>(IEntityQuery<T>, IEntityContext, params RelationshipPath[])

public static QueryBatch.AsyncResultGenerator<T, RelationshipTree> GetGraph<T>(IEntityQuery<T> query, IEntityContext context, params RelationshipPath[] paths) where T : IEntity

Parameters

query IEntityQuery<T>
context IEntityContext
paths RelationshipPath[]

Returns

QueryBatch.AsyncResultGenerator<T, RelationshipTree>

Type Parameters

T

GetGraph<TEntity, TTree>(IEntityQuery<TEntity>, IEntityContext, TTree?)

public static QueryBatch.AsyncResultGenerator<TEntity, TTree> GetGraph<TEntity, TTree>(IEntityQuery<TEntity> query, IEntityContext context, TTree? tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>

Parameters

query IEntityQuery<TEntity>
context IEntityContext
tree TTree

Returns

QueryBatch.AsyncResultGenerator<TEntity, TTree>

Type Parameters

TEntity
TTree

GetReferenceAsync<T>(EntityReferenceProperty<T>, CancellationToken?, params RelationshipPath[])

public static Task<T?> GetReferenceAsync<T>(EntityReferenceProperty<T> reference, CancellationToken? cancellationToken = null, params RelationshipPath[] paths) where T : IEntity<T>

Parameters

reference EntityReferenceProperty<T>
cancellationToken CancellationToken?
paths RelationshipPath[]

Returns

Task<T>

Type Parameters

T

GetReferenceAsync<TEntity, TTree>(EntityReferenceProperty<TEntity>, TTree, CancellationToken?)

public static Task<TEntity?> GetReferenceAsync<TEntity, TTree>(EntityReferenceProperty<TEntity> reference, TTree tree, CancellationToken? cancellationToken = null) where TEntity : IEntity<TEntity> where TTree : IRelationshipTree<TTree>

Parameters

reference EntityReferenceProperty<TEntity>
tree TTree
cancellationToken CancellationToken?

Returns

Task<TEntity>

Type Parameters

TEntity
TTree

LoadAsync(IEntityContext, CancellationToken?)

public Task LoadAsync(IEntityContext context, CancellationToken? cancellationToken = null)

Parameters

context IEntityContext
cancellationToken CancellationToken?

Returns

Task