![]() |
Nabû 1.0.0
Standardizing .NET developments with abstractions
|
Implémente les DAO interagissant directement avec la base de données. More...
Public Member Functions | |
void | Dispose () |
virtual async ValueTask | DisposeAsync () |
TReturn | SelectMethod< T, TSelect, TReturn > (ISpecification< T > spec, Expression< Func< T, TSelect > > mapper, Expression< Func< IQueryable< TSelect >, TReturn > > method) |
Execute method on ReadRequest result as IQueryable. | |
async Task< T > | AddAsync< T > (T entity, CancellationToken cancellationToken=default) |
Add an entity. | |
async Task | AddAsync< T > (IEnumerable< T > entities, CancellationToken cancellationToken=default) |
Add entities. | |
async Task< bool > | AnyAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default) |
Check if at least one entity match specification. | |
async Task< int > | CountAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default) |
count entities that match the specification in storage | |
async Task | DeleteAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default) |
Remove all entities that match the specification. | |
async Task< T?> | FirstOrDefaultAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default) |
returns the first entity that matches the specification | |
async Task< T?> | GetByIdAsync< T > (string id, CancellationToken cancellationToken=default) |
return the entity with specified Id | |
IIncludeEvaluator< T > | GetIncludeEvaluator< T > () |
async Task< IReadOnlyList< T > > | ListAllAsync< T > (CancellationToken cancellationToken=default) |
return all entities from storage | |
async Task< IReadOnlyList< T > > | ListAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default) |
Return all entities that match the specification. | |
async Task< IReadOnlyList< TS > > | SelectAllAsync< T, TS > (Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default) |
async Task< IReadOnlyList< TS > > | SelectAsync< T, TS > (ISpecification< T > spec, Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default) |
async Task< TS?> | SelectByIdAsync< T, TS > (string id, Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default) |
async Task< TS?> | SelectFirstOrDefaultAsync< T, TS > (ISpecification< T > spec, Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default) |
async Task< IReadOnlyList< TS > > | SelectGroupBy< T, TKey, TS > (ISpecification< T > spec, Expression< Func< T, TKey > > groupBy, Expression< Func< IGrouping< TKey, T >, TS > > mapper, CancellationToken cancellationToken=default) |
async Task | TransactionBegin (CancellationToken cancellationToken=default) |
Begin transaction. | |
async Task | TransactionCommit (CancellationToken cancellationToken=default) |
Commit current transaction. | |
Task | TransactionMakeSavePoint (string name, CancellationToken cancellationToken=default) |
Make named save point in transaction. | |
Task | TransactionRemoveSavePoint (string name, CancellationToken cancellationToken=default) |
Remove named save point in transaction. | |
async Task | TransactionRollback (CancellationToken cancellationToken=default) |
Rollback current transaction. | |
Task | TransactionRollbackToSavePoint (string name, CancellationToken cancellationToken=default) |
Rollback transaction to specified savepoint. | |
async Task | UpdateAsync< T > (T entity, CancellationToken cancellationToken=default) |
update entity | |
async Task | UpdateAsync< T > (IEnumerable< T > entities, CancellationToken cancellationToken=default) |
update entities | |
async Task | UpdateAsync< T > (ISpecification< T > spec, Action< T > updater, CancellationToken cancellationToken=default) |
Apply updater to entities that match specification. | |
async Task< IReadOnlyList< TFinal > > | EvaluateJoinQuery< T1, T2, TKey, TSelect, TFinal > (IJoinQuery< T1, T2, TKey, TSelect, TFinal > joinQuery, CancellationToken cancellationToken=default) |
Execute read query with multiple Joins. | |
![]() | |
Task< IReadOnlyList< TSelect > > | SelectAllAsync< T, TSelect > (Expression< Func< T, TSelect > > mapper, CancellationToken cancellationToken=default) |
return list of TSelect mapped from all entities from storage | |
Task< IReadOnlyList< TSelect > > | SelectAsync< T, TSelect > (ISpecification< T > spec, Expression< Func< T, TSelect > > mapper, CancellationToken cancellationToken=default) |
return list of TSelect mapped from all entities that match the specification | |
Task< TSelect?> | SelectByIdAsync< T, TSelect > (string id, Expression< Func< T, TSelect > > mapper, CancellationToken cancellationToken=default) |
return TSelect mapped from entity with specified Id | |
Task< TSelect?> | SelectFirstOrDefaultAsync< T, TSelect > (ISpecification< T > spec, Expression< Func< T, TSelect > > mapper, CancellationToken cancellationToken=default) |
return TSelect mapped from first entity that match specification | |
Task< IReadOnlyList< TSelect > > | SelectGroupBy< T, TKey, TSelect > (ISpecification< T > spec, Expression< Func< T, TKey > > groupBy, Expression< Func< IGrouping< TKey, T >, TSelect > > mapper, CancellationToken cancellationToken=default) |
return list of TSelect mapped from all entities that match the specification grouped by specified expression | |
Protected Member Functions | |
AbstractLiteDbDao (TDbContext dbContext, ILogger< AbstractLiteDbDao< TDbContext > >? logger) | |
virtual void | SetUpdateDateOnEntity< T > (T entity) |
IQueryable< TFinal >? | EvaluateJoinAsQueryGeneric< T1, T2, TKey, TSelect, TFinal > (IQueryable< T1 > joinSource, IJoinQuery< T1, T2, TKey, TSelect, TFinal >? joinQuery) |
virtual void | Dispose (bool dispose) |
virtual async Task< IEnumerable< T > > | ApplySpecificationAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default) |
virtual IEnumerable< T > | ApplySpecification< T > (ISpecification< T > spec) |
Properties | |
TDbContext | Context [get] |
Implémente les DAO interagissant directement avec la base de données.
TDbContext | : | AbstractLiteDbContext | |
TDbContext | : | IDaoContext |
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.AddAsync< T > | ( | IEnumerable< T > | entities, |
CancellationToken | cancellationToken = default ) |
Add entities.
entities | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< T > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.AddAsync< T > | ( | T | entity, |
CancellationToken | cancellationToken = default ) |
Add an entity.
entity | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< bool > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.AnyAsync< T > | ( | ISpecification< T > | spec, |
CancellationToken | cancellationToken = default ) |
Check if at least one entity match specification.
spec | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
|
protectedvirtual |
T | : | class | |
T | : | IEntity | |
T | : | new() |
|
protectedvirtual |
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< int > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.CountAsync< T > | ( | ISpecification< T > | spec, |
CancellationToken | cancellationToken = default ) |
count entities that match the specification in storage
spec | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.DeleteAsync< T > | ( | ISpecification< T > | spec, |
CancellationToken | cancellationToken = default ) |
Remove all entities that match the specification.
spec | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
|
protected |
T2 | : | class | |
T2 | : | IEntity | |
T2 | : | new() |
async Task< IReadOnlyList< TFinal > > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.EvaluateJoinQuery< T1, T2, TKey, TSelect, TFinal > | ( | IJoinQuery< T1, T2, TKey, TSelect, TFinal > | joinQuery, |
CancellationToken | cancellationToken = default ) |
Execute read query with multiple Joins.
joinQuery | |
cancellationToken |
T1 | |
T2 | |
TKey | |
TSelect | |
TFinal |
Implements Nabu.Data.IDao.
T1 | : | class | |
T1 | : | IEntity | |
T1 | : | new() | |
T2 | : | class | |
T2 | : | IEntity | |
T2 | : | new() |
async Task< T?> Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.FirstOrDefaultAsync< T > | ( | ISpecification< T > | spec, |
CancellationToken | cancellationToken = default ) |
returns the first entity that matches the specification
spec | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< T?> Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.GetByIdAsync< T > | ( | string | id, |
CancellationToken | cancellationToken = default ) |
return the entity with specified Id
id | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
IIncludeEvaluator< T > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.GetIncludeEvaluator< T > | ( | ) |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity |
async Task< IReadOnlyList< T > > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.ListAllAsync< T > | ( | CancellationToken | cancellationToken = default | ) |
return all entities from storage
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< IReadOnlyList< T > > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.ListAsync< T > | ( | ISpecification< T > | spec, |
CancellationToken | cancellationToken = default ) |
Return all entities that match the specification.
spec | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< IReadOnlyList< TS > > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.SelectAllAsync< T, TS > | ( | Expression< Func< T, TS > > | mapper, |
CancellationToken | cancellationToken = default ) |
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< IReadOnlyList< TS > > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.SelectAsync< T, TS > | ( | ISpecification< T > | spec, |
Expression< Func< T, TS > > | mapper, | ||
CancellationToken | cancellationToken = default ) |
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< TS?> Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.SelectByIdAsync< T, TS > | ( | string | id, |
Expression< Func< T, TS > > | mapper, | ||
CancellationToken | cancellationToken = default ) |
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< TS?> Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.SelectFirstOrDefaultAsync< T, TS > | ( | ISpecification< T > | spec, |
Expression< Func< T, TS > > | mapper, | ||
CancellationToken | cancellationToken = default ) |
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task< IReadOnlyList< TS > > Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.SelectGroupBy< T, TKey, TS > | ( | ISpecification< T > | spec, |
Expression< Func< T, TKey > > | groupBy, | ||
Expression< Func< IGrouping< TKey, T >, TS > > | mapper, | ||
CancellationToken | cancellationToken = default ) |
T | : | class | |
T | : | IEntity | |
T | : | new() |
TReturn Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.SelectMethod< T, TSelect, TReturn > | ( | ISpecification< T > | spec, |
Expression< Func< T, TSelect > > | mapper, | ||
Expression< Func< IQueryable< TSelect >, TReturn > > | method ) |
Execute method on ReadRequest result as IQueryable.
spec | |
mapper | |
method |
T | |
TSelect | |
TReturn |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
|
protectedvirtual |
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.TransactionBegin | ( | CancellationToken | cancellationToken = default | ) |
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.TransactionCommit | ( | CancellationToken | cancellationToken = default | ) |
Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.TransactionMakeSavePoint | ( | string | name, |
CancellationToken | cancellationToken = default ) |
Make named save point in transaction.
name | |
cancellationToken |
Implements Nabu.Data.IDao.
Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.TransactionRemoveSavePoint | ( | string | name, |
CancellationToken | cancellationToken = default ) |
Remove named save point in transaction.
name | |
cancellationToken |
Implements Nabu.Data.IDao.
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.TransactionRollback | ( | CancellationToken | cancellationToken = default | ) |
Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.TransactionRollbackToSavePoint | ( | string | name, |
CancellationToken | cancellationToken = default ) |
Rollback transaction to specified savepoint.
name | |
cancellationToken |
Implements Nabu.Data.IDao.
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.UpdateAsync< T > | ( | IEnumerable< T > | entities, |
CancellationToken | cancellationToken = default ) |
update entities
entities | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.UpdateAsync< T > | ( | ISpecification< T > | spec, |
Action< T > | updater, | ||
CancellationToken | cancellationToken = default ) |
Apply updater to entities that match specification.
spec | |
updater | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
async Task Nabu.Data.LiteDb.AbstractLiteDbDao< TDbContext >.UpdateAsync< T > | ( | T | entity, |
CancellationToken | cancellationToken = default ) |
update entity
entity | |
cancellationToken |
T |
Implements Nabu.Data.IDao.
T | : | class | |
T | : | IEntity | |
T | : | new() |
|
get |
Implements Nabu.Data.IDao< TContext >.