reorganization of database layer
This commit is contained in:
38
UserService.DatabaseLayer/Repository/IRepository.cs
Normal file
38
UserService.DatabaseLayer/Repository/IRepository.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using UserService.DatabaseLayer.DataModels;
|
||||
|
||||
namespace UserService.DatabaseLayer.Repository
|
||||
{
|
||||
public interface IRepository<T> where T : Node
|
||||
{
|
||||
Task<IReadOnlyList<T>> GetAllAsync(CancellationToken token = default);
|
||||
Task<T?> GetAsync(Expression<Func<T, bool>> predicate, CancellationToken token = default);
|
||||
Task AddAsync(T entity, CancellationToken token = default);
|
||||
Task 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>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user