Developer 02 1b793e2b75 Add CancellationToken support to IRepository methods
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.
2025-04-16 09:17:38 +02:00

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);
}