Interface ISet<TEntity>
- Namespace
- eQuantic.Core.Data.Repository
- Assembly
- eQuantic.Core.Data.dll
The database set interface.
public interface ISet<TEntity> : IQueryable<TEntity>, IEnumerable<TEntity>, IQueryable, IEnumerable where TEntity : class, IEntity
Type Parameters
TEntityThe type of the entity.
- Inherited Members
- Extension Methods
Methods
DeleteMany(Expression<Func<TEntity, bool>>)
Deletes many entities matching the supplied predicate.
long DeleteMany(Expression<Func<TEntity, bool>> filter)
Parameters
filterExpression<Func<TEntity, bool>>The predicate.
Returns
- long
The number of deleted entities.
DeleteManyAsync(Expression<Func<TEntity, bool>>, CancellationToken)
Deletes many entities matching the supplied predicate asynchronously.
Task<long> DeleteManyAsync(Expression<Func<TEntity, bool>> filter, CancellationToken cancellationToken = default)
Parameters
filterExpression<Func<TEntity, bool>>The predicate.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Execute()
Executes the current query.
IEnumerable<TEntity> Execute()
Returns
- IEnumerable<TEntity>
The materialized entities.
FindAsync<TKey>(TKey, CancellationToken)
Finds the entity with the specified key asynchronously.
Task<TEntity?> FindAsync<TKey>(TKey key, CancellationToken cancellationToken = default)
Parameters
keyTKeyThe key.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<TEntity>
The entity, or
nullwhen not found.
Type Parameters
TKeyThe type of the key.
Find<TKey>(TKey)
Finds the entity with the specified key.
TEntity? Find<TKey>(TKey key)
Parameters
keyTKeyThe key.
Returns
- TEntity
The entity, or
nullwhen not found.
Type Parameters
TKeyThe type of the key.
Insert(TEntity)
Inserts the specified item.
void Insert(TEntity item)
Parameters
itemTEntityThe item.
InsertAsync(TEntity, CancellationToken)
Inserts the specified item asynchronously.
Task InsertAsync(TEntity item, CancellationToken cancellationToken = default)
Parameters
itemTEntityThe item.
cancellationTokenCancellationTokenThe cancellation token.
Returns
UpdateMany(Expression<Func<TEntity, bool>>, Expression<Func<TEntity, TEntity>>)
Updates many entities matching the supplied predicate.
long UpdateMany(Expression<Func<TEntity, bool>> filter, Expression<Func<TEntity, TEntity>> updateExpression)
Parameters
filterExpression<Func<TEntity, bool>>The predicate.
updateExpressionExpression<Func<TEntity, TEntity>>The update expression.
Returns
- long
The number of updated entities.
UpdateManyAsync(Expression<Func<TEntity, bool>>, Expression<Func<TEntity, TEntity>>, CancellationToken)
Updates many entities matching the supplied predicate asynchronously.
Task<long> UpdateManyAsync(Expression<Func<TEntity, bool>> filter, Expression<Func<TEntity, TEntity>> updateExpression, CancellationToken cancellationToken = default)
Parameters
filterExpression<Func<TEntity, bool>>The predicate.
updateExpressionExpression<Func<TEntity, TEntity>>The update expression.
cancellationTokenCancellationTokenThe cancellation token.