reorganization of database layer

This commit is contained in:
2020-07-25 22:15:58 +02:00
parent 2a86c16b85
commit 110663456d
25 changed files with 471 additions and 370 deletions

View 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>
{
}
}