Updated the IRepository<TEntity> interface to include an optional CancellationToken parameter in the asynchronous methods: CreateAsync, ReadAsync, UpdateAsync, and DeleteAsync. Modified the DbRepository<TDbContext, TEntity> class to align with these changes, ensuring method signatures are consistent with the interface.
17 lines
670 B
C#
17 lines
670 B
C#
using System.Linq.Expressions;
|
|
|
|
namespace DigitalData.Core.Abstractions.Infrastructure;
|
|
|
|
public interface IRepository<TEntity>
|
|
{
|
|
public Task<TEntity> CreateAsync<TDto>(TDto dto, CancellationToken ct = default);
|
|
|
|
public Task<TEntity> CreateAsync<TDto>(IEnumerable<TDto> dtos, CancellationToken ct = default);
|
|
|
|
public Task<IEnumerable<TEntity>> ReadAsync(Expression? expression = null, CancellationToken ct = default);
|
|
|
|
public Task<IEnumerable<TEntity>> UpdateAsync<TDto>(TDto dto, Expression expression, CancellationToken ct = default);
|
|
|
|
public Task<IEnumerable<TEntity>> DeleteAsync<TDto>(Expression expression, CancellationToken ct = default);
|
|
}
|