Template
16 lines
650 B
C#
16 lines
650 B
C#
using System.Linq.Expressions;
|
|
using RT.Domain.Entities;
|
|
|
|
namespace RT.Infrastructure.Repositories;
|
|
|
|
public interface IRepository<T> where T : BaseEntity
|
|
{
|
|
Task<T?> GetByIdAsync(Guid id, CancellationToken ct = default);
|
|
Task<IEnumerable<T>> GetAllAsync(CancellationToken ct = default);
|
|
Task<int> CountAsync(Expression<Func<T, bool>>? predicate = null, CancellationToken ct = default);
|
|
Task InsertAsync(T entity, CancellationToken ct = default);
|
|
Task UpdateAsync(T entity, CancellationToken ct = default);
|
|
Task RemoveAsync(T entity, CancellationToken ct = default);
|
|
Task SaveChangesAsync(CancellationToken ct = default);
|
|
}
|