Nabû 1.0.0
Standardizing .NET developments with abstractions
Nabu.Playground.AspNet.AspDao Class Reference
+ Inheritance diagram for Nabu.Playground.AspNet.AspDao:

Public Member Functions

 AspDao (AspDbContext? dbContext)
 
- Public Member Functions inherited from Nabu.Data.EntityFramework.AbstractEntityFrameworkDao< TDbContext >
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.
 
virtual async Task< T > AddAsync< T > (T entity, CancellationToken cancellationToken=default)
 Add an entity.
Parameters
entity
cancellationToken
Template Parameters
T
Returns
inserted entity

 
virtual async Task AddAsync< T > (IEnumerable< T > entities, CancellationToken cancellationToken=default)
 Add entities.
Parameters
entities
cancellationToken
Template Parameters
T

 
virtual async Task< bool > AnyAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default)
 Check if at least one entity match specification.
Parameters
spec
cancellationToken
Template Parameters
T
Returns
true if at least one entity match specification

 
virtual async Task< int > CountAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default)
 count entities that match the specification in storage
Parameters
spec
cancellationToken
Template Parameters
T
Returns
number of entities that match the specification

 
virtual async Task DeleteAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default)
 Remove all entities that match the specification.
Parameters
spec
cancellationToken
Template Parameters
T
Returns

 
virtual async Task< T?> FirstOrDefaultAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default)
 returns the first entity that matches the specification
Parameters
spec
cancellationToken
Template Parameters
T
Returns
first entity that matches the specification

 
virtual async Task< T?> GetByIdAsync< T > (string id, CancellationToken cancellationToken=default)
 return the entity with specified Id
Parameters
id
cancellationToken
Template Parameters
T
Returns
entity with specified Id

 
virtual IIncludeEvaluator< T > GetIncludeEvaluator< T > ()
 
virtual async Task< IReadOnlyList< T > > ListAllAsync< T > (CancellationToken cancellationToken=default)
 return all entities from storage
Parameters
cancellationToken
Template Parameters
T
Returns
all entities from storage

 
virtual async Task< IReadOnlyList< T > > ListAsync< T > (ISpecification< T > spec, CancellationToken cancellationToken=default)
 Return all entities that match the specification.
Parameters
spec
cancellationToken
Template Parameters
T
Returns
all entities that match the specification

 
virtual async Task< IReadOnlyList< TS > > SelectAllAsync< T, TS > (Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default)
 
virtual async Task< IReadOnlyList< TS > > SelectAsync< T, TS > (ISpecification< T > spec, Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default)
 
virtual async Task< TS?> SelectByIdAsync< T, TS > (string id, Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default)
 
virtual async Task< TS?> SelectFirstOrDefaultAsync< T, TS > (ISpecification< T > spec, Expression< Func< T, TS > > mapper, CancellationToken cancellationToken=default)
 
virtual 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.
Parameters
cancellationToken
Returns

 
async Task TransactionCommit (CancellationToken cancellationToken=default)
 Commit current transaction.
Parameters
cancellationToken
Returns

 
async Task TransactionMakeSavePoint (string name, CancellationToken cancellationToken=default)
 Make named save point in transaction.
Parameters
name
cancellationToken
Returns

 
async Task TransactionRemoveSavePoint (string name, CancellationToken cancellationToken=default)
 Remove named save point in transaction.
Parameters
name
cancellationToken
Returns

 
async Task TransactionRollback (CancellationToken cancellationToken=default)
 Rollback current transaction.
Parameters
cancellationToken
Returns

 
async Task TransactionRollbackToSavePoint (string name, CancellationToken cancellationToken=default)
 Rollback transaction to specified savepoint.
Parameters
name
cancellationToken
Returns

 
virtual async Task UpdateAsync< T > (T entity, CancellationToken cancellationToken=default)
 update entity
Parameters
entity
cancellationToken
Template Parameters
T
Returns

 
virtual async Task UpdateAsync< T > (IEnumerable< T > entities, CancellationToken cancellationToken=default)
 update entities
Parameters
entities
cancellationToken
Template Parameters
T
Returns

 
virtual async Task UpdateAsync< T > (ISpecification< T > spec, Action< T > updater, CancellationToken cancellationToken=default)
 Apply updater to entities that match specification.
Parameters
spec
updater
cancellationToken
Template Parameters
T
Returns

 
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.
 
void Dispose ()
 
async ValueTask DisposeAsync ()
 
- Public Member Functions inherited from Nabu.Data.IDao
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
 

Additional Inherited Members

- Protected Member Functions inherited from Nabu.Data.EntityFramework.AbstractEntityFrameworkDao< TDbContext >
 AbstractEntityFrameworkDao (TDbContext? dbContext)
 
IQueryable< TFinal >? EvaluateJoinAsQueryGeneric< T1, T2, TKey, TSelect, TFinal > (IQueryable< T1 > joinSource, IJoinQuery< T1, T2, TKey, TSelect, TFinal >? joinQuery)
 
IQueryable< TFinal >? EvaluateJoinAsQuery< TSelect, TFinal > (IQueryable< TSelect > joinSource, IJoinQuery? joinQuery)
 
virtual Task BeforeRequest (CancellationToken cancellationToken=default)
 
virtual Task AfterUpdate (CancellationToken cancellationToken=default)
 
virtual IQueryable< T > ApplySpecification< T > (ISpecification< T > spec, bool noTracking=true)
 
virtual void SetUpdateDateOnEntity< T > (T entity)
 
virtual void Dispose (bool disposing)
 
virtual async ValueTask DisposeAsyncCore ()
 
- Protected Attributes inherited from Nabu.Data.EntityFramework.AbstractEntityFrameworkDao< TDbContext >
TDbContext? _dbContext
 
IDbContextTransaction? _transaction
 
- Properties inherited from Nabu.Data.EntityFramework.AbstractEntityFrameworkDao< TDbContext >
TDbContext Context [get]