using OpenHarbor.CQRS.DynamicQuery.Abstractions; namespace DigitalOps.Dal; public class DefaultQueryableProvider(MainDbContext context, IServiceProvider serviceProvider) : IQueryableProvider where TEntity : class { public Task> GetQueryableAsync(object query, CancellationToken cancellationToken = default) { if (serviceProvider.GetService(typeof(IQueryableProviderOverride)) is IQueryableProviderOverride queryableProviderOverride) return queryableProviderOverride.GetQueryableAsync(query, cancellationToken); return Task.FromResult(context.Set().AsQueryable()); } }