using System.Linq.Expressions;

namespace NetinaShop.Repository.Repositories.Entity.Abstracts;

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

    Task<TSetting> GetEntityAsync<TSetting>(Guid id,CancellationToken cancellation) where TSetting : notnull;
    Task<TSetting> GetEntityAsync<TSetting>(Expression<Func<TSetting, bool>> expression, CancellationToken cancellation) where TSetting : notnull;

    Task AddOrUpdateEntityAsync<TSetting>(TSetting setting, CancellationToken cancellation) where TSetting : notnull;
    Task RemoveEntityAsync<TSetting>(CancellationToken cancellation);
}