removed devexpress and refactoring
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@ -8,7 +10,7 @@ using UserService.DatabaseLayer.DataModels;
|
||||
|
||||
namespace UserService.DatabaseLayer.Repository
|
||||
{
|
||||
public class BaseRepository<T> where T : class
|
||||
public class BaseRepository<T> where T : Node
|
||||
{
|
||||
private readonly Func<UserServiceDbContext, DbSet<T>> _context;
|
||||
|
||||
@ -20,7 +22,7 @@ namespace UserService.DatabaseLayer.Repository
|
||||
public async Task<IReadOnlyList<T>> GetAllAsync(CancellationToken token = default)
|
||||
{
|
||||
await using var db = new UserServiceDbContext();
|
||||
return await _context(db).ToListAsync(token);
|
||||
return await _context(db).Include(x => x.Parent).ToListAsync(token);
|
||||
}
|
||||
|
||||
public async Task<T?> GetAsync(Expression<Func<T, bool>> predicate, CancellationToken token = default)
|
||||
|
Reference in New Issue
Block a user