Skip to content

Commit

Permalink
Proper naming
Browse files Browse the repository at this point in the history
  • Loading branch information
axelheer committed Jan 9, 2025
1 parent 66120cf commit 6bb1ed0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public void ApplyServices(IServiceCollection services)
var descriptor = services[index];
if (descriptor.ServiceType != typeof(IQueryCompiler))
continue;
if (!typeof(EntityQueryCompilerAdapter).IsAssignableTo(descriptor.ImplementationType))
if (!typeof(RewriteQueryCompiler).IsAssignableTo(descriptor.ImplementationType))
continue;

services[index] = new ServiceDescriptor(
descriptor.ServiceType,
typeof(EntityQueryCompilerAdapter),
typeof(RewriteQueryCompiler),
descriptor.Lifetime
);

Expand All @@ -46,7 +46,7 @@ public void ApplyServices(IServiceCollection services)
if (!adapterAdded)
throw new InvalidOperationException("Unable to create rewrite adapter for actual query compiler. Please configure your query provider first!");

_ = services.AddSingleton(new EntityQueryCompilerAdapterOptions(rewriters));
_ = services.AddSingleton(new RewriteQueryCompilerOptions(rewriters));
}

public RewriteDbContextOptionsExtension WithRewriter(ExpressionVisitor rewriter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace NeinLinq;

#pragma warning disable EF1001

internal sealed class EntityQueryCompilerAdapter : QueryCompiler
internal sealed class RewriteQueryCompiler : QueryCompiler
{
private readonly EntityQueryCompilerAdapterOptions options;
private readonly RewriteQueryCompilerOptions options;

public EntityQueryCompilerAdapter(EntityQueryCompilerAdapterOptions options,
public RewriteQueryCompiler(RewriteQueryCompilerOptions options,
IQueryContextFactory queryContextFactory,
ICompiledQueryCache compiledQueryCache,
ICompiledQueryCacheKeyGenerator compiledQueryCacheKeyGenerator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace NeinLinq;

internal sealed class EntityQueryCompilerAdapterOptions
internal sealed class RewriteQueryCompilerOptions
{
public IReadOnlyList<ExpressionVisitor> Rewriters { get; }

public EntityQueryCompilerAdapterOptions(params ExpressionVisitor[] rewriters)
public RewriteQueryCompilerOptions(params ExpressionVisitor[] rewriters)
{
Rewriters = new List<ExpressionVisitor>(rewriters);
}
Expand Down

0 comments on commit 6bb1ed0

Please sign in to comment.