39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
#nullable enable
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq.Expressions;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using UserService.Infrastructure.DataModels;
|
|
|
|
namespace UserService.DatabaseLayer.Repository
|
|
{
|
|
public interface IRepository<T> where T : Node
|
|
{
|
|
Task<IReadOnlyList<T>> GetAllAsync(Expression<Func<T, bool>>? predicate = null, CancellationToken token = default);
|
|
Task<T?> GetAsync(Expression<Func<T, bool>> predicate, CancellationToken token = default);
|
|
Task AddAsync(T entity, CancellationToken token = default);
|
|
Task<bool> UpdateAsync(T entity, CancellationToken token = default);
|
|
Task DeleteAsync(T entity, CancellationToken token = default);
|
|
}
|
|
|
|
public interface IOrganizationUnitsRepository : IRepository<OrganizationUnit>
|
|
{
|
|
|
|
}
|
|
|
|
public interface ISecurityGroupsRepository : IRepository<SecurityGroup>
|
|
{
|
|
|
|
}
|
|
|
|
public interface IUsersRepository : IRepository<User>
|
|
{
|
|
|
|
}
|
|
|
|
public interface INodesRepository : IRepository<Node>
|
|
{
|
|
|
|
}
|
|
} |