42 lines
1.1 KiB
C#
42 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.DatabaseLayer.DataModels;
|
|
using UserService.Infrastructure.DataModels;
|
|
|
|
namespace UserService.DatabaseLayer.Repositories
|
|
{
|
|
public interface IRepository<T> where T : class
|
|
{
|
|
Task<IReadOnlyList<T>> GetAllAsync(Expression<Func<NodeModel, bool>>? predicate = null, CancellationToken token = default);
|
|
Task<T?> GetAsync(Expression<Func<NodeModel, bool>> predicate, CancellationToken token = default);
|
|
Task<int> 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 IMembersRepository
|
|
{
|
|
|
|
}
|
|
|
|
|
|
} |