try another way to implement the data stucture

This commit is contained in:
2020-09-30 22:05:18 +02:00
parent 410062daae
commit 1b387adae1
19 changed files with 234 additions and 257 deletions

View File

@ -4,14 +4,15 @@ using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using DataModels;
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<T, bool>>? predicate = null, CancellationToken token = default);
Task<T?> GetAsync(Expression<Func<T, bool>> predicate, CancellationToken token = default);
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 AddAsync(T entity, CancellationToken token = default);
Task<bool> UpdateAsync(T entity, CancellationToken token = default);
Task DeleteAsync(T entity, CancellationToken token = default);