using System.Linq.Expressions;

namespace NetinaShop.Repository.Repositories.Marten;

public interface IMartenRepository<TMartenEntity> : IScopedDependency where TMartenEntity : IMartenEntity
{
    Task<List<TMartenEntity>> GetEntitiesAsync(CancellationToken cancellation);
    Task<List<TMartenEntity>> GetEntitiesAsync(Expression<Func<TMartenEntity, bool>> expression, CancellationToken cancellation);

    Task<TMartenEntity> GetEntityAsync(Guid id, CancellationToken cancellation);
    Task<TMartenEntity?> GetEntityAsync(Expression<Func<TMartenEntity, bool>> expression, CancellationToken cancellation);

    Task AddOrUpdateEntityAsync(TMartenEntity setting, CancellationToken cancellation);
    Task RemoveEntityAsync(CancellationToken cancellation);
}