Class QueryBatch
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
deferErrorsboolDefer 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
Methods
AddCollection<T>(IEntitySet<T>, params RelationshipPath[])
public QueryBatch.Result<ILoadedSet<T>> AddCollection<T>(IEntitySet<T> collection, params RelationshipPath[] paths) where T : IEntity
Parameters
collectionIEntitySet<T>pathsRelationshipPath[]
Returns
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
collectionIEntitySet<TEntity>treeTTree
Returns
- QueryBatch.Result<ILoadedSet<TEntity>>
Type Parameters
TEntityTTree
AddGetByID(IEntityInfo, IEntityContext, Guid, params RelationshipPath[])
public QueryBatch.Result<IEntity> AddGetByID(IEntityInfo info, IEntityContext context, Guid ID, params RelationshipPath[] paths)
Parameters
infoIEntityInfocontextIEntityContextIDGuidpathsRelationshipPath[]
Returns
AddGetByIDOrDefault(IEntityInfo, IEntityContext, Guid?, params RelationshipPath[])
public QueryBatch.Result<IEntity?> AddGetByIDOrDefault(IEntityInfo info, IEntityContext context, Guid? ID, params RelationshipPath[] paths)
Parameters
infoIEntityInfocontextIEntityContextIDGuid?pathsRelationshipPath[]
Returns
AddGetByIDOrDefault<T>(IEntityContext, Guid?, params RelationshipPath[])
public QueryBatch.Result<T?> AddGetByIDOrDefault<T>(IEntityContext context, Guid? ID, params RelationshipPath[] paths) where T : IEntity<T>
Parameters
contextIEntityContextIDGuid?pathsRelationshipPath[]
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
contextIEntityContextIDGuidpathsRelationshipPath[]
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
rootsIEnumerable<T>pathsRelationshipPath[]
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
queryIEntityQuery<T>pathsRelationshipPath[]
Returns
Type Parameters
T
AddGraph<T>(T, params RelationshipPath[])
public void AddGraph<T>(T root, params RelationshipPath[] paths) where T : IEntity
Parameters
rootTpathsRelationshipPath[]
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
rootsIEnumerable<TEntity>treeTTree
Type Parameters
TEntityTTree
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
queryIEntityQuery<TEntity>treeTTree
Returns
- QueryBatch.ResultGenerator<TEntity, TTree>
Type Parameters
TEntityTTree
AddGraph<TEntity, TTree>(TEntity, TTree?)
public void AddGraph<TEntity, TTree>(TEntity root, TTree? tree) where TEntity : IEntity where TTree : IRelationshipTree<TTree>
Parameters
rootTEntitytreeTTree
Type Parameters
TEntityTTree
AddQuery<T>(IEntityQuery<T>)
public QueryBatch.ResultGenerator<T, RelationshipTree> AddQuery<T>(IEntityQuery<T> query)
Parameters
queryIEntityQuery<T>
Returns
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
referenceEntityReferenceProperty<T>pathsRelationshipPath[]
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
referenceEntityReferenceProperty<TEntity>treeTTree
Returns
- QueryBatch.Result<TEntity>
Type Parameters
TEntityTTree
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
infoIEntityInfocontextIEntityContextIDGuidcancellationTokenCancellationToken?pathsRelationshipPath[]
Returns
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
contextIEntityContextIDGuidcancellationTokenCancellationToken?pathsRelationshipPath[]
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
infoIEntityInfocontextIEntityContextIDGuid?cancellationTokenCancellationToken?pathsRelationshipPath[]
Returns
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
contextIEntityContextIDGuid?cancellationTokenCancellationToken?pathsRelationshipPath[]
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
collectionIEntitySet<T>cancellationTokenCancellationToken?pathsRelationshipPath[]
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
collectionIEntitySet<TEntity>treeTTreecancellationTokenCancellationToken?
Returns
- Task<ILoadedSet<TEntity>>
Type Parameters
TEntityTTree
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
queryIEntityQuery<T>contextIEntityContextpathsRelationshipPath[]
Returns
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
queryIEntityQuery<TEntity>contextIEntityContexttreeTTree
Returns
- QueryBatch.AsyncResultGenerator<TEntity, TTree>
Type Parameters
TEntityTTree
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
referenceEntityReferenceProperty<T>cancellationTokenCancellationToken?pathsRelationshipPath[]
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
referenceEntityReferenceProperty<TEntity>treeTTreecancellationTokenCancellationToken?
Returns
- Task<TEntity>
Type Parameters
TEntityTTree
LoadAsync(IEntityContext, CancellationToken?)
public Task LoadAsync(IEntityContext context, CancellationToken? cancellationToken = null)
Parameters
contextIEntityContextcancellationTokenCancellationToken?