using AsbCloudDb.Model; using Microsoft.EntityFrameworkCore; using System; using System.Linq; namespace AsbCloudInfrastructure.Repository; public class QueryContainer where TEntity : class, IId { protected readonly IAsbCloudDbContext dbContext; protected readonly DbSet dbSet; protected readonly Func> GetQuery; public QueryContainer(IAsbCloudDbContext context) { dbContext = context; dbSet = context.Set(); GetQuery = () => dbSet; } public QueryContainer(IAsbCloudDbContext context, Func, IQueryable> makeQuery) { dbContext = context; dbSet = context.Set(); GetQuery = () => makeQuery(dbSet); } }