2024-04-01 13:05:11 +03:30
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
|
|
2024-04-16 20:01:34 +03:30
|
|
|
|
namespace Netina.Repository.Repositories.Marten;
|
2024-04-01 13:05:11 +03:30
|
|
|
|
|
|
|
|
|
|
public interface IMartenRepository<TMartenEntity> : IScopedDependency where TMartenEntity : IMartenEntity
|
|
|
|
|
|
{
|
2024-05-14 12:46:11 +03:30
|
|
|
|
Task<List<TMartenEntity>> GetEntitiesAsync(CancellationToken cancellation = default);
|
|
|
|
|
|
Task<List<TMartenEntity>> GetEntitiesAsync(Expression<Func<TMartenEntity, bool>> expression, CancellationToken cancellation = default);
|
2024-08-07 16:15:53 +03:30
|
|
|
|
Task<List<TMartenEntity>> GetEntitiesAsync(int page, int count, CancellationToken cancellation);
|
|
|
|
|
|
Task<List<TMartenEntity>> GetEntitiesAsync(Expression<Func<TMartenEntity, bool>> expression, int page, int count, CancellationToken cancellation);
|
2024-04-01 13:05:11 +03:30
|
|
|
|
|
2024-05-14 12:46:11 +03:30
|
|
|
|
Task<TMartenEntity> GetEntityAsync(Guid id, CancellationToken cancellation = default);
|
|
|
|
|
|
Task<TMartenEntity?> GetEntityAsync(Expression<Func<TMartenEntity, bool>> expression, CancellationToken cancellation = default);
|
2024-04-01 13:05:11 +03:30
|
|
|
|
|
2024-05-14 12:46:11 +03:30
|
|
|
|
Task AddOrUpdateEntityAsync(TMartenEntity entity, CancellationToken cancellation = default);
|
2024-08-07 16:15:53 +03:30
|
|
|
|
Task UpdateEntityAsync(TMartenEntity entity, CancellationToken cancellation = default);
|
2024-05-14 12:46:11 +03:30
|
|
|
|
Task RemoveEntityAsync(TMartenEntity entity, CancellationToken cancellation = default);
|
2024-04-01 13:05:11 +03:30
|
|
|
|
}
|