using System.Linq.Expressions;

namespace Brizco.Repository.Repositories.Marten;

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

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

    Task AddOrUpdateEntityAsync(TMartenEntity entity, CancellationToken cancellation = default);
    Task RemoveEntityAsync(TMartenEntity entity, CancellationToken cancellation = default);
}