diff --git a/benchmarks/ExpressiveSharp.Benchmarks/PolyfillGeneratorBenchmarks.cs b/benchmarks/ExpressiveSharp.Benchmarks/PolyfillGeneratorBenchmarks.cs
index c7c911f9..244bcd88 100644
--- a/benchmarks/ExpressiveSharp.Benchmarks/PolyfillGeneratorBenchmarks.cs
+++ b/benchmarks/ExpressiveSharp.Benchmarks/PolyfillGeneratorBenchmarks.cs
@@ -7,94 +7,283 @@
namespace ExpressiveSharp.Benchmarks;
+///
+/// Baseline: all call sites in a single source file.
+/// Varies to show how cost scales with site count.
+///
+/// NOTE – two benchmark variants:
+///
+/// - * — uses RunGenerators (generator pipeline only, no compilation update).
+/// The O(N) overhead here comes from the driver maintaining N cached output entries in its
+/// internal state.
+/// - *_E2E — uses RunGeneratorsAndUpdateCompilation (full pipeline including
+/// the Roslyn compilation rebuild).
+/// This variant measures end-to-end cost, including applying generated sources to the
+/// compilation, so results reflect both generator work and compilation-update overhead.
+/// Use this variant when comparing overall IDE-like responsiveness rather than isolated
+/// generator-pipeline cost.
+///
+///
[MemoryDiagnoser]
-public class PolyfillGeneratorBenchmarks
+public class PolyfillSingleFileBenchmarks
{
- [Params(1, 100)]
+ [Params(1, 10, 100)]
public int CallSiteCount { get; set; }
private Compilation _compilation = null!;
private GeneratorDriver _warmedDriver = null!;
- private Compilation _modifiedCompilation = null!;
+ // Entity file (Polyfill0.cs) has NO call sites — editing it should trigger zero re-transforms.
+ private Compilation _entityFileModified = null!;
+ // Query file (Polyfill1.cs) contains the call sites — editing it forces all N re-transforms.
+ private Compilation _queryFileModified = null!;
[GlobalSetup]
public void Setup()
{
- var sources = BuildPolyfillSources(CallSiteCount);
- _compilation = CreatePolyfillCompilation(sources);
+ var sources = BuildSources(CallSiteCount);
+ _compilation = CreateCompilation(sources);
_warmedDriver = CSharpGeneratorDriver
.Create(new PolyfillInterceptorGenerator())
- .RunGeneratorsAndUpdateCompilation(_compilation, out _, out _);
+ .RunGenerators(_compilation);
+
+ // index 0 = entity (no call sites)
+ var entityTree = _compilation.SyntaxTrees.ElementAt(0);
+ _entityFileModified = _compilation.ReplaceSyntaxTree(
+ entityTree,
+ entityTree.WithChangedText(SourceText.From(entityTree.GetText() + "\n// bench-edit")));
- var firstTree = _compilation.SyntaxTrees.First();
- _modifiedCompilation = _compilation.ReplaceSyntaxTree(
- firstTree,
- firstTree.WithChangedText(SourceText.From(firstTree.GetText() + "\n// bench-edit")));
+ // index 1 = queries (CallSiteCount call sites)
+ var queryTree = _compilation.SyntaxTrees.ElementAt(1);
+ _queryFileModified = _compilation.ReplaceSyntaxTree(
+ queryTree,
+ queryTree.WithChangedText(SourceText.From(queryTree.GetText() + "\n// bench-edit")));
}
+ // ── Generator-only (no compilation rebuild) ──────────────────────────────
+
+ ///
+ /// Fresh driver, runs all per-node transforms from scratch.
+ ///
[Benchmark(Baseline = true)]
- public GeneratorDriver RunGenerator()
+ public GeneratorDriver Cold()
+ => CSharpGeneratorDriver
+ .Create(new PolyfillInterceptorGenerator())
+ .RunGenerators(_compilation);
+
+ ///
+ /// Incremental edit on a file with ZERO call sites.
+ /// Zero transforms should re-run; cost above baseline = pipeline evaluation overhead only.
+ ///
+ [Benchmark]
+ public GeneratorDriver Incremental_EditEntityFile()
+ => _warmedDriver.RunGenerators(_entityFileModified);
+
+ ///
+ /// Incremental edit on the file containing all call sites.
+ /// All transforms must re-run; shows the per-site transform cost.
+ /// Should be ≈ Cold.
+ ///
+ [Benchmark]
+ public GeneratorDriver Incremental_EditQueryFile()
+ => _warmedDriver.RunGenerators(_queryFileModified);
+
+ // ── End-to-end (generator + Roslyn compilation rebuild) ──────────────────
+ // Compilation-rebuild cost dominates at large N; see the generator-only variants above
+ // for a clean measurement of caching savings.
+
+ [Benchmark]
+ public GeneratorDriver Cold_E2E()
=> CSharpGeneratorDriver
.Create(new PolyfillInterceptorGenerator())
.RunGeneratorsAndUpdateCompilation(_compilation, out _, out _);
[Benchmark]
- public GeneratorDriver RunGenerator_Incremental()
- => _warmedDriver
- .RunGeneratorsAndUpdateCompilation(_modifiedCompilation, out _, out _);
+ public GeneratorDriver Incremental_EditEntityFile_E2E()
+ => _warmedDriver.RunGeneratorsAndUpdateCompilation(_entityFileModified, out _, out _);
- private static Compilation CreatePolyfillCompilation(IReadOnlyList sources)
- {
- var references = Basic.Reference.Assemblies.Net100.References.All.ToList();
- references.Add(MetadataReference.CreateFromFile(typeof(ExpressiveAttribute).Assembly.Location));
+ [Benchmark]
+ public GeneratorDriver Incremental_EditQueryFile_E2E()
+ => _warmedDriver.RunGeneratorsAndUpdateCompilation(_queryFileModified, out _, out _);
+ private static Compilation CreateCompilation(IReadOnlyList sources)
+ {
+ var refs = Basic.Reference.Assemblies.Net100.References.All.ToList();
+ refs.Add(MetadataReference.CreateFromFile(typeof(ExpressiveAttribute).Assembly.Location));
return CSharpCompilation.Create(
- "PolyfillBenchmarkInput",
- sources.Select((s, idx) => CSharpSyntaxTree.ParseText(s, path: $"Polyfill{idx}.cs")),
- references,
+ "PolyfillSingleFileBench",
+ sources.Select((s, i) => CSharpSyntaxTree.ParseText(s, path: $"Polyfill{i}.cs")),
+ refs,
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
}
- private static IReadOnlyList BuildPolyfillSources(int callSiteCount)
+ private static IReadOnlyList BuildSources(int callSiteCount)
{
- var sources = new List();
-
- // Entity class
- sources.Add(@"
+ var sources = new List
+ {
+ // index 0: entity — NO call sites
+ @"
using System;
using System.Linq;
using ExpressiveSharp;
+namespace PolyfillBench;
+public class BenchEntity { public int Id { get; set; } public string Name { get; set; } = """"; }
+"
+ };
+
+ // index 1: queries — all callSiteCount call sites
+ var sb = new StringBuilder();
+ sb.AppendLine("using System.Linq; using ExpressiveSharp; namespace PolyfillBench;");
+ sb.AppendLine("public static class Queries {");
+ for (var i = 0; i < callSiteCount; i++)
+ sb.AppendLine($" public static IQueryable Q{i}(IExpressiveQueryable q) => q.Select(x => x.Id + {i});");
+ sb.AppendLine("}");
+ sources.Add(sb.ToString());
-namespace PolyfillBenchmarkInput;
+ return sources;
+ }
+}
-public class BenchEntity
+///
+/// Multi-file scenario: call sites spread across source files.
+/// Each file contains a fixed call sites.
+/// Demonstrates the key incremental-caching benefit from the no-Collect() pipeline design:
+/// each call site registers its output independently, so only changed files are re-processed.
+///
+/// Key comparisons (generator-only variants):
+///
+/// - Cold — all FileCount × CallSitesPerFile transforms from scratch. Should scale linearly.
+/// - Incremental_EditCallSiteFile — only 1 file re-processed (CallSitesPerFile transforms). Cost ≈ constant regardless of FileCount.
+/// - Incremental_EditNoiseFile — zero transforms re-run; pipeline overhead only. Cost ≈ constant regardless of FileCount.
+///
+/// Expected: Cold grows linearly; Incremental_EditCallSiteFile and
+/// Incremental_EditNoiseFile stay near-flat as grows.
+/// The difference between them = cost of transforms.
+///
+/// Why this works: Instead of snippets.Collect() (which forces O(total_sites)
+/// array re-assembly on every run), each snippet is registered directly via
+/// RegisterSourceOutput. Roslyn's per-output cache means unchanged call sites'
+/// output files are served from cache with zero work.
+///
+/// E2E variants include the Roslyn compilation-rebuild cost which also scales
+/// with file count and can partially mask the generator savings.
+///
+[MemoryDiagnoser]
+public class PolyfillMultiFileBenchmarks
{
- public int Id { get; set; }
- public string Name { get; set; } = string.Empty;
- public decimal Amount { get; set; }
-}
-");
+ [Params(1, 5, 10)]
+ public int FileCount { get; set; }
- // Call sites — each in its own method to generate distinct interceptors
- var sb = new StringBuilder();
- sb.AppendLine("using System;");
- sb.AppendLine("using System.Linq;");
- sb.AppendLine("using ExpressiveSharp;");
- sb.AppendLine();
- sb.AppendLine("namespace PolyfillBenchmarkInput;");
- sb.AppendLine();
- sb.AppendLine("public static class Queries");
- sb.AppendLine("{");
+ private const int CallSitesPerFile = 5;
- for (var i = 0; i < callSiteCount; i++)
+ private Compilation _compilation = null!;
+ private GeneratorDriver _warmedDriver = null!;
+ private Compilation _callSiteFileModified = null!;
+ private Compilation _noiseFileModified = null!;
+
+ [GlobalSetup]
+ public void Setup()
+ {
+ var sources = BuildSources(FileCount, CallSitesPerFile);
+ _compilation = CreateCompilation(sources);
+
+ _warmedDriver = CSharpGeneratorDriver
+ .Create(new PolyfillInterceptorGenerator())
+ .RunGenerators(_compilation);
+
+ // Index FileCount = last query file (has CallSitesPerFile call sites)
+ var callSiteTree = _compilation.SyntaxTrees.ElementAt(FileCount);
+ _callSiteFileModified = _compilation.ReplaceSyntaxTree(
+ callSiteTree,
+ callSiteTree.WithChangedText(SourceText.From(callSiteTree.GetText() + "\n// bench-edit")));
+
+ // Index FileCount + 1 = noise file (zero call sites)
+ var noiseTree = _compilation.SyntaxTrees.ElementAt(FileCount + 1);
+ _noiseFileModified = _compilation.ReplaceSyntaxTree(
+ noiseTree,
+ noiseTree.WithChangedText(SourceText.From(noiseTree.GetText() + "\n// bench-edit")));
+ }
+
+ // ── Generator-only (no compilation rebuild) ──────────────────────────────
+
+ /// All FileCount × CallSitesPerFile transforms run from scratch.
+ [Benchmark(Baseline = true)]
+ public GeneratorDriver Cold()
+ => CSharpGeneratorDriver
+ .Create(new PolyfillInterceptorGenerator())
+ .RunGenerators(_compilation);
+
+ ///
+ /// Edits a file that contains call sites.
+ /// That file's transforms re-run; all other files' transforms come from cache.
+ /// Cost ≈ transforms regardless of .
+ ///
+ [Benchmark]
+ public GeneratorDriver Incremental_EditCallSiteFile()
+ => _warmedDriver.RunGenerators(_callSiteFileModified);
+
+ ///
+ /// Edits a file with NO call sites.
+ /// Zero transforms should re-run. Expected cost ≈ pipeline overhead only (near-flat vs FileCount).
+ /// The gap vs Incremental_EditCallSiteFile isolates the per-site transform cost.
+ ///
+ [Benchmark]
+ public GeneratorDriver Incremental_EditNoiseFile()
+ => _warmedDriver.RunGenerators(_noiseFileModified);
+
+ // ── End-to-end (generator + Roslyn compilation rebuild) ──────────────────
+
+ [Benchmark]
+ public GeneratorDriver Cold_E2E()
+ => CSharpGeneratorDriver
+ .Create(new PolyfillInterceptorGenerator())
+ .RunGeneratorsAndUpdateCompilation(_compilation, out _, out _);
+
+ [Benchmark]
+ public GeneratorDriver Incremental_EditCallSiteFile_E2E()
+ => _warmedDriver.RunGeneratorsAndUpdateCompilation(_callSiteFileModified, out _, out _);
+
+ [Benchmark]
+ public GeneratorDriver Incremental_EditNoiseFile_E2E()
+ => _warmedDriver.RunGeneratorsAndUpdateCompilation(_noiseFileModified, out _, out _);
+
+ private static Compilation CreateCompilation(IReadOnlyList sources)
+ {
+ var refs = Basic.Reference.Assemblies.Net100.References.All.ToList();
+ refs.Add(MetadataReference.CreateFromFile(typeof(ExpressiveAttribute).Assembly.Location));
+ return CSharpCompilation.Create(
+ "PolyfillMultiFileBench",
+ sources.Select((s, i) => CSharpSyntaxTree.ParseText(s, path: $"Polyfill{i}.cs")),
+ refs,
+ new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
+ }
+
+ private static IReadOnlyList BuildSources(int fileCount, int sitesPerFile)
+ {
+ // index 0: entity
+ var sources = new List
{
- sb.AppendLine($" public static IQueryable Query{i}(IExpressiveQueryable q)");
- sb.AppendLine($" => q.Select(x => x.Id + {i});");
+ @"using System.Linq; using ExpressiveSharp; namespace PolyfillBench;
+public class BenchEntity { public int Id { get; set; } public string Name { get; set; } = """"; }"
+ };
+
+ // indices 1..fileCount: query files
+ var sb = new StringBuilder();
+ for (var f = 0; f < fileCount; f++)
+ {
+ sb.Clear();
+ sb.AppendLine("using System.Linq; using ExpressiveSharp; namespace PolyfillBench;");
+ sb.AppendLine($"public static class Queries{f} {{");
+ for (var i = 0; i < sitesPerFile; i++)
+ sb.AppendLine($" public static IQueryable Q{f}_{i}(IExpressiveQueryable q) => q.Select(x => x.Id + {f * 100 + i});");
+ sb.AppendLine("}");
+ sources.Add(sb.ToString());
}
- sb.AppendLine("}");
- sources.Add(sb.ToString());
+ // index fileCount + 1: noise — no call sites at all
+ sources.Add(@"namespace PolyfillBench;
+/// No IExpressiveQueryable here — editing this file should cost zero generator work.
+public static class BenchHelper { public static string Describe(int id) => $""#{id}""; }");
return sources;
}
diff --git a/src/ExpressiveSharp.Generator/PolyfillInterceptorGenerator.cs b/src/ExpressiveSharp.Generator/PolyfillInterceptorGenerator.cs
index cf4c0e2f..e211d711 100644
--- a/src/ExpressiveSharp.Generator/PolyfillInterceptorGenerator.cs
+++ b/src/ExpressiveSharp.Generator/PolyfillInterceptorGenerator.cs
@@ -1,11 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.Immutable;
-using System.Linq;
using System.Text;
using ExpressiveSharp.Generator.Infrastructure;
-using ExpressiveSharp.Generator.Models;
-using ExpressiveSharp.Generator.SyntaxRewriters;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
@@ -102,53 +96,97 @@ file static class __ClosureHelper
public void Initialize(IncrementalGeneratorInitializationContext context)
{
- // Syntactic pre-filter: any member-access invocation with at least one argument
- // is a candidate. The semantic check in Emit does the real filtering.
- var candidates = context.SyntaxProvider.CreateSyntaxProvider(
- predicate: static (node, _) =>
- node is InvocationExpressionSyntax inv &&
- inv.Expression is MemberAccessExpressionSyntax &&
- inv.ArgumentList.Arguments.Count > 0,
- transform: static (ctx, _) => (InvocationExpressionSyntax)ctx.Node);
-
- var globalOptions = context.AnalyzerConfigOptionsProvider
- .Select(static (opts, _) => new ExpressiveGlobalOptions(opts.GlobalOptions));
-
- // Combine with the full compilation so we can do semantic analysis in the output step.
- context.RegisterSourceOutput(
- candidates.Collect().Combine(context.CompilationProvider).Combine(globalOptions),
- static (spc, pair) => Emit(pair.Left.Left, pair.Left.Right, pair.Right, spc));
+ // One pipeline item per SOURCE FILE (CompilationUnitSyntax = root node of each file).
+ // The syntactic scan filters out files that have no candidate invocations at all.
+ // This gives us one generated file per user source file — clean and predictable.
+ var candidateFiles = context.SyntaxProvider.CreateSyntaxProvider(
+ predicate: static (node, _) => node is CompilationUnitSyntax,
+ transform: static (ctx, ct) =>
+ {
+ ct.ThrowIfCancellationRequested();
+ var unit = (CompilationUnitSyntax)ctx.Node;
+ // Quick syntactic pre-filter: any member-access invocation with ≥1 argument?
+ foreach (var descendant in unit.DescendantNodes())
+ {
+ if (descendant is InvocationExpressionSyntax inv &&
+ inv.Expression is MemberAccessExpressionSyntax &&
+ inv.ArgumentList.Arguments.Count > 0)
+ return unit;
+ }
+ return null;
+ })
+ .Where(static x => x is not null)
+ .Select(static (x, _) => x!);
+
+ // Combine with the compilation so ProcessFileAndEmit can build a SemanticModel.
+ //
+ // WithComparer uses REFERENCE equality on the CompilationUnitSyntax root node:
+ // • Roslyn syntax trees are immutable — editing a noise file creates a new
+ // Compilation but keeps every other file's syntax tree root as the EXACT
+ // SAME object reference across incremental runs.
+ // • All untouched source files compare as "equal" → RegisterSourceOutput
+ // skipped entirely → O(1) incremental cost for noise-file edits.
+ // • Only files that were actually edited get a new root reference → re-run.
+ var filesWithCompilation = candidateFiles
+ .Combine(context.CompilationProvider)
+ .WithComparer(CompilationUnitAndCompilationComparer.Instance);
+
+ // All semantic analysis, code emission, and EXP_EMIT_FAILED diagnostic reporting
+ // happen inside ProcessFileAndEmit. One output file is produced per source file,
+ // containing all interceptors for that file.
+ context.RegisterSourceOutput(filesWithCompilation,
+ static (spc, pair) => ProcessFileAndEmit(pair.Left, pair.Right, spc));
}
- // ── Emission ─────────────────────────────────────────────────────────────
+ // ── Per-file processing and emission ────────────────────────────────────
- private static void Emit(
- ImmutableArray invocations,
+ ///
+ /// Processes all candidate call sites in one source file and emits a single
+ /// interceptor file containing all generated methods for that file.
+ /// Called from RegisterSourceOutput; Roslyn replays cached output when
+ /// signals the file is unchanged.
+ ///
+ private static void ProcessFileAndEmit(
+ CompilationUnitSyntax unit,
Compilation compilation,
- ExpressiveGlobalOptions globalOptions,
SourceProductionContext spc)
{
- var methodsBuilder = new StringBuilder();
- var snippetCount = 0;
+ var ct = spc.CancellationToken;
+ var model = compilation.GetSemanticModel(unit.SyntaxTree);
+ var sourcePath = unit.SyntaxTree.FilePath;
+ var fileTag = GetFileTag(sourcePath);
+
+ var methodCodes = new List();
+ var needsClosureHelper = false;
- foreach (var inv in invocations)
+ foreach (var descendant in unit.DescendantNodes())
{
- spc.CancellationToken.ThrowIfCancellationRequested();
+ if (descendant is not InvocationExpressionSyntax inv) continue;
+ if (inv.Expression is not MemberAccessExpressionSyntax) continue;
+ if (inv.ArgumentList.Arguments.Count == 0) continue;
+ ct.ThrowIfCancellationRequested();
try
{
- var snippet = TryEmitPolyfill(inv, compilation, spc, snippetCount, globalOptions)
- ?? TryEmit(inv, compilation, spc, snippetCount, globalOptions);
- if (snippet is not null)
- {
- methodsBuilder.Append(snippet);
- snippetCount++;
- }
+ // Use the METHOD NAME token position for stable, unique naming.
+ // Using the invocation's span-start would collide in chained calls
+ // (e.g. query.AsExpressive().Where(…) — both start at 'query').
+ var ma = (MemberAccessExpressionSyntax)inv.Expression;
+ var nameLineSpan = ma.Name.GetLocation().GetLineSpan();
+ var line = nameLineSpan.StartLinePosition.Line;
+ var col = nameLineSpan.StartLinePosition.Character;
+
+ var methodCode = TryEmitPolyfill(inv, model, line, col, fileTag, spc)
+ ?? TryEmit(inv, model, line, col, fileTag, spc);
+ if (methodCode is null) continue;
+
+ methodCodes.Add(methodCode);
+ if (methodCode.Contains("__ClosureHelper"))
+ needsClosureHelper = true;
}
- catch (Exception ex) when (ex is not OperationCanceledException)
+ catch (OperationCanceledException) { throw; }
+ catch (Exception ex)
{
- // Report the failure so it doesn't hide bugs silently.
- // The stub body will throw UnreachableException at runtime with a clear message.
spc.ReportDiagnostic(Diagnostic.Create(
Diagnostics.InterceptorEmissionFailed,
inv.GetLocation(),
@@ -156,19 +194,19 @@ private static void Emit(
}
}
- if (snippetCount == 0) return;
+ if (methodCodes.Count == 0) return;
- var methods = methodsBuilder.ToString();
- var closureHelper = methods.Contains("__ClosureHelper") ? ClosureHelperSource : "";
+ var allMethods = string.Concat(methodCodes);
+ var closureHelper = needsClosureHelper ? ClosureHelperSource : "";
var source = $$"""
//
#nullable disable
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
- {{methods}} }{{closureHelper}}
+ {{allMethods}} }{{closureHelper}}
}
namespace System.Runtime.CompilerServices
@@ -181,10 +219,49 @@ public InterceptsLocationAttribute(int version, string data) { }
}
""";
- spc.AddSource("PolyfillInterceptors.g.cs",
+ spc.AddSource(ComputeOutputFileName(sourcePath),
SourceText.From(source, Encoding.UTF8));
}
+ ///
+ /// Computes a stable output file name for a given source file.
+ /// One interceptor file is generated per source file, keyed by the full 32-bit
+ /// FNV-1a hash of the source path.
+ ///
+ private static string ComputeOutputFileName(string sourcePath)
+ {
+ unchecked
+ {
+ var hash = 2166136261u;
+ for (var i = 0; i < sourcePath.Length; i++)
+ {
+ hash ^= (uint)sourcePath[i];
+ hash *= 16777619u;
+ }
+ return "PolyfillInterceptors_" + hash.ToString("x8") + ".g.cs";
+ }
+ }
+
+ ///
+ /// Returns a short (4-char hex) tag derived from the source file path hash.
+ /// Used as a prefix in interceptor method names to prevent collisions between
+ /// files that have call sites at identical line/col positions.
+ ///
+ private static string GetFileTag(string sourcePath)
+ {
+ unchecked
+ {
+ var hash = 2166136261u;
+ for (var i = 0; i < sourcePath.Length; i++)
+ {
+ hash ^= (uint)sourcePath[i];
+ hash *= 16777619u;
+ }
+ return (hash & 0xFFFFu).ToString("x4");
+ }
+ }
+
+
// ── ExpressionPolyfill.Create() interception ──────────────────────────
///
@@ -192,15 +269,13 @@ public InterceptsLocationAttribute(int version, string data) { }
/// an interceptor that returns a literal Expression<TDelegate> with the
/// rewritten lambda body.
///
- private static string? TryEmitPolyfill(
- InvocationExpressionSyntax inv,
- Compilation compilation,
- SourceProductionContext spc,
- int index,
- ExpressiveGlobalOptions globalOptions)
+ private static string? TryEmitPolyfill(InvocationExpressionSyntax inv,
+ SemanticModel model,
+ int line,
+ int col,
+ string fileTag,
+ SourceProductionContext spc)
{
- var model = compilation.GetSemanticModel(inv.SyntaxTree);
-
if (model.GetSymbolInfo(inv).Symbol is not IMethodSymbol method)
return null;
@@ -219,12 +294,10 @@ public InterceptsLocationAttribute(int version, string data) { }
return null;
var hasTransformers = method.Parameters.Length == 2;
- var interceptableLocation = Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInterceptableLocation(
- model, inv, spc.CancellationToken);
+ var interceptableLocation = model.GetInterceptableLocation(inv, spc.CancellationToken);
if (interceptableLocation is null)
return null;
- var interceptAttr = Microsoft.CodeAnalysis.CSharp.CSharpExtensions
- .GetInterceptsLocationAttributeSyntax(interceptableLocation);
+ var interceptAttr = interceptableLocation.GetInterceptsLocationAttributeSyntax();
// Extract the delegate type — e.g., Func
var delegateType = method.TypeArguments[0];
@@ -233,7 +306,6 @@ public InterceptsLocationAttribute(int version, string data) { }
// Default to Rewrite (the whole point of Polyfill is enabling expression tree features),
// but allow MSBuild global property to override.
-
// Get the parameter types from the delegate to build Expression
// For Func, the lambda parameters map to T1..Tn
if (delegateType is not INamedTypeSymbol delegateNamed || delegateNamed.TypeArguments.IsEmpty)
@@ -245,9 +317,8 @@ public InterceptsLocationAttribute(int version, string data) { }
return null;
// Use ExpressionTreeEmitter to build the expression tree
- var exprTypeFqn = $"global::System.Linq.Expressions.Expression<{delegateFqn}>";
- var emitResult = EmitLambdaBody(lam, elemSymbol, model, spc, globalOptions, delegateFqn,
- varPrefix: $"i{index}_", delegateVarName: "__func");
+ var emitResult = EmitLambdaBody(lam, elemSymbol, model, spc, delegateFqn,
+ varPrefix: $"i{fileTag}{line}c{col}_", delegateVarName: "__func");
if (emitResult is null)
return null;
@@ -255,7 +326,7 @@ public InterceptsLocationAttribute(int version, string data) { }
{
return $$"""
{{interceptAttr}}
- internal static global::System.Linq.Expressions.Expression<{{delegateFqn}}> {{MethodId("Create", index)}}(
+ internal static global::System.Linq.Expressions.Expression<{{delegateFqn}}> {{MethodId("Create", fileTag, line, col)}}(
{{delegateFqn}} __func,
params global::ExpressiveSharp.IExpressionTreeTransformer[] transformers)
{
@@ -269,7 +340,7 @@ public InterceptsLocationAttribute(int version, string data) { }
return $$"""
{{interceptAttr}}
- internal static global::System.Linq.Expressions.Expression<{{delegateFqn}}> {{MethodId("Create", index)}}(
+ internal static global::System.Linq.Expressions.Expression<{{delegateFqn}}> {{MethodId("Create", fileTag, line, col)}}(
{{delegateFqn}} __func)
{
{{emitResult.Body}} return __lambda;
@@ -280,14 +351,13 @@ public InterceptsLocationAttribute(int version, string data) { }
// ── Per-invocation dispatch (IExpressiveQueryable) ───────────────────────
- private static string? TryEmit(
- InvocationExpressionSyntax inv,
- Compilation compilation,
- SourceProductionContext spc,
- int index,
- ExpressiveGlobalOptions globalOptions)
+ private static string? TryEmit(InvocationExpressionSyntax inv,
+ SemanticModel model,
+ int line,
+ int col,
+ string fileTag,
+ SourceProductionContext spc)
{
- var model = compilation.GetSemanticModel(inv.SyntaxTree);
var ma = (MemberAccessExpressionSyntax)inv.Expression;
// Receiver must be or implement IExpressiveQueryable.
@@ -321,14 +391,12 @@ public InterceptsLocationAttribute(int version, string data) { }
// Get the interceptable location using the Roslyn 5.0+ API.
// This produces the correct [InterceptsLocation(version, data)] attribute text.
- var interceptableLocation = Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInterceptableLocation(
- model, inv, spc.CancellationToken);
+ var interceptableLocation = model.GetInterceptableLocation(inv, spc.CancellationToken);
if (interceptableLocation is null)
return null;
- var interceptAttr = Microsoft.CodeAnalysis.CSharp.CSharpExtensions
- .GetInterceptsLocationAttributeSyntax(interceptableLocation);
+ var interceptAttr = interceptableLocation.GetInterceptsLocationAttributeSyntax();
// Element type T of IExpressiveQueryable.
// The receiver may be IExpressiveQueryable directly, or a type that implements it.
@@ -337,7 +405,7 @@ public InterceptsLocationAttribute(int version, string data) { }
return null;
var elementType = rewritableInterface.TypeArguments[0];
if (elementType is not INamedTypeSymbol elementSymbol)
- return null; // Skip when T is itself a type parameter
+ return null;
var elementFqn = elementType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
var methodName = ma.Name.Identifier.Text;
@@ -354,7 +422,8 @@ public InterceptsLocationAttribute(int version, string data) { }
targetTypeFqn = targetType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
}
- return EmitGenericLambda(inv, model, spc, interceptAttr, index, methodName, elementSymbol, elementFqn, method, funcParamIndices, targetTypeFqn, globalOptions);
+ return EmitGenericLambda(inv, model, spc, interceptAttr, line, col, fileTag,
+ methodName, elementSymbol, elementFqn, method, funcParamIndices, targetTypeFqn);
}
// ── Lambda helpers ───────────────────────────────────────────────────────
@@ -366,10 +435,8 @@ public InterceptsLocationAttribute(int version, string data) { }
private static Emitter.EmitResult? EmitLambdaBody(
LambdaExpressionSyntax lambda,
INamedTypeSymbol elementSymbol,
-
SemanticModel model,
SourceProductionContext spc,
- ExpressiveGlobalOptions globalOptions,
string delegateTypeFqn,
string assignToVariable = "__lambda",
string varPrefix = "",
@@ -453,7 +520,16 @@ private static bool IsAnonymousType(ITypeSymbol type)
// ── Formatting helpers ───────────────────────────────────────────────────
- private static string MethodId(string op, int index) => $"__Polyfill_{op}_{index}";
+ ///
+ /// Produces a unique, stable interceptor method name based on the call site's
+ /// source file hash + method-name-token position (line/col).
+ /// The file hash disambiguates call sites across different source files that happen
+ /// to share the same line/col (e.g., two files both have an OrderBy at 44:13).
+ /// The position component disambiguates multiple call sites within the same file.
+ /// Adding/removing methods in other files never shifts these identifiers.
+ ///
+ private static string MethodId(string op, string fileTag, int line, int col)
+ => $"__Polyfill_{op}_{fileTag}_{line}_{col}";
///
/// Generic lambda emitter for all LINQ operators and user-defined stubs.
@@ -465,11 +541,10 @@ private static bool IsAnonymousType(ITypeSymbol type)
/// Non-lambda parameters are forwarded directly to the Queryable.* call.
///
private static string? EmitGenericLambda(
- InvocationExpressionSyntax inv, SemanticModel model,
- SourceProductionContext spc, string interceptAttr, int idx,
+ InvocationExpressionSyntax inv, SemanticModel model, SourceProductionContext spc,
+ string interceptAttr, int line, int col, string fileTag,
string methodName, INamedTypeSymbol elemSym, string elemFqn,
- IMethodSymbol method, List funcParamIndices, string targetTypeFqn,
- ExpressiveGlobalOptions globalOptions)
+ IMethodSymbol method, List funcParamIndices, string targetTypeFqn)
{
// ── Extract all lambda expressions from the Func<> argument positions ──
var lambdas = new List(funcParamIndices.Count);
@@ -583,7 +658,10 @@ private static bool IsAnonymousType(ITypeSymbol type)
if (typeAliases.TryGetValue(returnElemType!, out var retParam))
returnRef = retParam;
else
- returnRef = returnElemType!.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
+ // Use ResolveTypeFqn so that composite return types like IGrouping
+ // are resolved through the type aliases (e.g. IGrouping instead of the
+ // compiler-generated anonymous type name which is not valid C#).
+ returnRef = ResolveTypeFqn(returnElemType!, typeAliases);
}
else
{
@@ -671,11 +749,11 @@ private static bool IsAnonymousType(ITypeSymbol type)
for (int j = 0; j < funcParamIndices.Count; j++)
{
var lambdaVar = single ? "__lambda" : $"__lambda{j + 1}";
- var prefix = single ? $"i{idx}_" : $"i{idx}{(char)('a' + j)}_";
+ var prefix = single ? $"i{fileTag}{line}c{col}_" : $"i{fileTag}{line}c{col}{(char)('a' + j)}_";
var delegateName = single ? "__func" : $"__func{j + 1}";
var funcType = (INamedTypeSymbol)method.Parameters[funcParamIndices[j]].Type;
var lambdaElemSym = funcType.TypeArguments[0] as INamedTypeSymbol ?? elemSym;
- var emitResult = EmitLambdaBody(lambdas[j], lambdaElemSym, model, spc, globalOptions,
+ var emitResult = EmitLambdaBody(lambdas[j], lambdaElemSym, model, spc,
delegateFqns[j], lambdaVar, varPrefix: prefix,
typeAliases: hasAnyAnon ? typeAliases : null,
delegateVarName: delegateName);
@@ -691,7 +769,7 @@ private static bool IsAnonymousType(ITypeSymbol type)
{
return $$"""
{{interceptAttr}}
- internal static global::ExpressiveSharp.IExpressiveQueryable<{{returnRef}}> {{MethodId(methodName, idx)}}(
+ internal static global::ExpressiveSharp.IExpressiveQueryable<{{returnRef}}> {{MethodId(methodName, fileTag, line, col)}}(
this global::ExpressiveSharp.IExpressiveQueryable<{{elemFqn}}> source,
{{interceptorParamList}})
{
@@ -706,7 +784,7 @@ private static bool IsAnonymousType(ITypeSymbol type)
return $$"""
{{interceptAttr}}
- internal static {{returnRef}} {{MethodId(methodName, idx)}}(
+ internal static {{returnRef}} {{MethodId(methodName, fileTag, line, col)}}(
this global::ExpressiveSharp.IExpressiveQueryable<{{elemFqn}}> source,
{{interceptorParamList}})
{
@@ -722,7 +800,7 @@ private static bool IsAnonymousType(ITypeSymbol type)
{
return $$"""
{{interceptAttr}}
- internal static global::ExpressiveSharp.IExpressiveQueryable<{{returnRef}}> {{MethodId(methodName, idx)}}{{typeParams}}(
+ internal static global::ExpressiveSharp.IExpressiveQueryable<{{returnRef}}> {{MethodId(methodName, fileTag, line, col)}}{{typeParams}}(
this global::ExpressiveSharp.IExpressiveQueryable<{{elemRef}}> source,
{{interceptorParamList}})
{
@@ -738,7 +816,7 @@ private static bool IsAnonymousType(ITypeSymbol type)
return $$"""
{{interceptAttr}}
- internal static {{returnRef}} {{MethodId(methodName, idx)}}{{typeParams}}(
+ internal static {{returnRef}} {{MethodId(methodName, fileTag, line, col)}}{{typeParams}}(
this global::ExpressiveSharp.IExpressiveQueryable<{{elemRef}}> source,
{{interceptorParamList}})
{
@@ -816,4 +894,39 @@ private static string ResolveTypeFqn(ITypeSymbol type, Dictionary
+ /// Compares (CompilationUnitSyntax, Compilation) pairs using REFERENCE
+ /// equality on the syntax root only, completely ignoring the Compilation.
+ ///
+ ///
+ /// Roslyn's incremental pipeline rebuilds the on every
+ /// file edit — even for files unrelated to our call sites. However, it keeps every
+ /// unchanged file's root as the exact same object reference
+ /// across incremental runs.
+ ///
+ ///
+ /// By using reference equality on the , editing
+ /// a noise file makes all untouched source-file pairs compare as "equal" → their
+ /// RegisterSourceOutput actions are skipped entirely → O(1) incremental cost
+ /// for noise-file edits, matching the pattern used by EntityFrameworkCore.Projectables.
+ ///
+ ///
+ private sealed class CompilationUnitAndCompilationComparer
+ : IEqualityComparer<(CompilationUnitSyntax Left, Compilation Right)>
+ {
+ public readonly static CompilationUnitAndCompilationComparer Instance
+ = new CompilationUnitAndCompilationComparer();
+
+ private CompilationUnitAndCompilationComparer() { }
+
+ public bool Equals(
+ (CompilationUnitSyntax Left, Compilation Right) x,
+ (CompilationUnitSyntax Left, Compilation Right) y)
+ => ReferenceEquals(x.Left, y.Left);
+
+ public int GetHashCode((CompilationUnitSyntax Left, Compilation Right) obj)
+ => System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(obj.Left);
+ }
}
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_GeneratesInterceptor.verified.txt
index 9ea82d31..7f9628c5 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_GeneratesInterceptor.verified.txt
@@ -3,25 +3,25 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_AggregateBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_AggregateBy_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func1,
decimal seed,
global::System.Func __func2)
{
// Source: o => o.Tag
- var i0a_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0a_expr_0 = global::System.Linq.Expressions.Expression.Property(i0a_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var __lambda1 = global::System.Linq.Expressions.Expression.Lambda>(i0a_expr_0, i0a_p_o);
+ var i361d10c18a_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18a_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d10c18a_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var __lambda1 = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18a_expr_0, i361d10c18a_p_o);
// Source: (acc, o) => acc + o.Price
- var i0b_p_acc = global::System.Linq.Expressions.Expression.Parameter(typeof(decimal), "acc");
- var i0b_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0b_expr_1 = global::System.Linq.Expressions.Expression.Property(i0b_p_o, typeof(global::TestNs.Order).GetProperty("Price")); // o.Price
- var i0b_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.Add, i0b_p_acc, i0b_expr_1);
- var __lambda2 = global::System.Linq.Expressions.Expression.Lambda>(i0b_expr_0, i0b_p_acc, i0b_p_o);
+ var i361d10c18b_p_acc = global::System.Linq.Expressions.Expression.Parameter(typeof(decimal), "acc");
+ var i361d10c18b_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18b_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18b_p_o, typeof(global::TestNs.Order).GetProperty("Price")); // o.Price
+ var i361d10c18b_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.Add, i361d10c18b_p_acc, i361d10c18b_expr_1);
+ var __lambda2 = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18b_expr_0, i361d10c18b_p_acc, i361d10c18b_p_o);
return global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.AggregateBy(
(global::System.Linq.IQueryable)source,
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_WithSeedSelector_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_WithSeedSelector_GeneratesInterceptor.verified.txt
index 827f6e4b..72da5d12 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_WithSeedSelector_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AggregateByTests.AggregateBy_WithSeedSelector_GeneratesInterceptor.verified.txt
@@ -3,29 +3,29 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_AggregateBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_AggregateBy_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func1,
global::System.Func __func2,
global::System.Func __func3)
{
// Source: o => o.Tag
- var i0a_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0a_expr_0 = global::System.Linq.Expressions.Expression.Property(i0a_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var __lambda1 = global::System.Linq.Expressions.Expression.Lambda>(i0a_expr_0, i0a_p_o);
+ var i361d10c18a_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18a_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d10c18a_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var __lambda1 = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18a_expr_0, i361d10c18a_p_o);
// Source: k => 0m
- var i0b_p_k = global::System.Linq.Expressions.Expression.Parameter(typeof(string), "k");
- var i0b_expr_0 = global::System.Linq.Expressions.Expression.Constant(0m, typeof(decimal)); // 0m
- var __lambda2 = global::System.Linq.Expressions.Expression.Lambda>(i0b_expr_0, i0b_p_k);
+ var i361d10c18b_p_k = global::System.Linq.Expressions.Expression.Parameter(typeof(string), "k");
+ var i361d10c18b_expr_0 = global::System.Linq.Expressions.Expression.Constant(0m, typeof(decimal)); // 0m
+ var __lambda2 = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18b_expr_0, i361d10c18b_p_k);
// Source: (acc, o) => acc + o.Price
- var i0c_p_acc = global::System.Linq.Expressions.Expression.Parameter(typeof(decimal), "acc");
- var i0c_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0c_expr_1 = global::System.Linq.Expressions.Expression.Property(i0c_p_o, typeof(global::TestNs.Order).GetProperty("Price")); // o.Price
- var i0c_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.Add, i0c_p_acc, i0c_expr_1);
- var __lambda3 = global::System.Linq.Expressions.Expression.Lambda>(i0c_expr_0, i0c_p_acc, i0c_p_o);
+ var i361d10c18c_p_acc = global::System.Linq.Expressions.Expression.Parameter(typeof(decimal), "acc");
+ var i361d10c18c_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18c_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18c_p_o, typeof(global::TestNs.Order).GetProperty("Price")); // o.Price
+ var i361d10c18c_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.Add, i361d10c18c_p_acc, i361d10c18c_expr_1);
+ var __lambda3 = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18c_expr_0, i361d10c18c_p_acc, i361d10c18c_p_o);
return global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.AggregateBy(
(global::System.Linq.IQueryable)source,
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Count_AfterAnonymousSelect_GeneratesScalarInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Count_AfterAnonymousSelect_GeneratesScalarInterceptor.verified.txt
index 0d79ad67..0cef92bc 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Count_AfterAnonymousSelect_GeneratesScalarInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Count_AfterAnonymousSelect_GeneratesScalarInterceptor.verified.txt
@@ -3,35 +3,35 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static int __Polyfill_Count_0(
+ internal static int __Polyfill_Count_361d_11_25(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: x => x.Total > 0m
- var i0_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
- var i0_expr_1 = global::System.Linq.Expressions.Expression.Property(i0_p_x, typeof(T0).GetProperty("Total")); // x.Total
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Constant(0m, typeof(decimal)); // 0m
- var i0_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i0_expr_1, i0_expr_2);
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_x);
+ var i361d11c25_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
+ var i361d11c25_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d11c25_p_x, typeof(T0).GetProperty("Total")); // x.Total
+ var i361d11c25_expr_2 = global::System.Linq.Expressions.Expression.Constant(0m, typeof(decimal)); // 0m
+ var i361d11c25_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i361d11c25_expr_1, i361d11c25_expr_2);
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d11c25_expr_0, i361d11c25_p_x);
return global::System.Linq.Queryable.Count(
(global::System.Linq.IQueryable)(object)source,
__lambda);
}
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_1(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_10_25(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: o => new { o.Id, o.Total }
- var i1_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
- var i1_expr_1 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Id")); // o.Id
- var i1_expr_2 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Total")); // o.Total
- var i1_expr_3 = typeof(T1).GetConstructors()[0];
- var i1_expr_0 = global::System.Linq.Expressions.Expression.New(i1_expr_3, new global::System.Linq.Expressions.Expression[] { i1_expr_1, i1_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Total") });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i1_expr_0, i1_p_o);
+ var i361d10c25_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
+ var i361d10c25_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c25_p_o, typeof(T0).GetProperty("Id")); // o.Id
+ var i361d10c25_expr_2 = global::System.Linq.Expressions.Expression.Property(i361d10c25_p_o, typeof(T0).GetProperty("Total")); // o.Total
+ var i361d10c25_expr_3 = typeof(T1).GetConstructors()[0];
+ var i361d10c25_expr_0 = global::System.Linq.Expressions.Expression.New(i361d10c25_expr_3, new global::System.Linq.Expressions.Expression[] { i361d10c25_expr_1, i361d10c25_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Total") });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c25_expr_0, i361d10c25_p_o);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.DistinctBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.DistinctBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
index 189e8c35..6eb39ac3 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.DistinctBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.DistinctBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
@@ -3,17 +3,17 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_DistinctBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_DistinctBy_361d_11_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: x => x.Category
- var i0_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_x, typeof(T0).GetProperty("Category")); // x.Category
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_x);
+ var i361d11c18_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
+ var i361d11c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d11c18_p_x, typeof(T0).GetProperty("Category")); // x.Category
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d11c18_expr_0, i361d11c18_p_x);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.DistinctBy(
@@ -21,17 +21,17 @@ namespace ExpressiveSharp.Generated.Interceptors
__lambda));
}
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_1(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: o => new { o.Id, o.Category }
- var i1_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
- var i1_expr_1 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Id")); // o.Id
- var i1_expr_2 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Category")); // o.Category
- var i1_expr_3 = typeof(T1).GetConstructors()[0];
- var i1_expr_0 = global::System.Linq.Expressions.Expression.New(i1_expr_3, new global::System.Linq.Expressions.Expression[] { i1_expr_1, i1_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Category") });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i1_expr_0, i1_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
+ var i361d10c18_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Id")); // o.Id
+ var i361d10c18_expr_2 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Category")); // o.Category
+ var i361d10c18_expr_3 = typeof(T1).GetConstructors()[0];
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.New(i361d10c18_expr_3, new global::System.Linq.Expressions.Expression[] { i361d10c18_expr_1, i361d10c18_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Category") });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.GroupBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.GroupBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
index 954c9a39..0346403d 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.GroupBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.GroupBy_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
@@ -3,35 +3,35 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable>> __Polyfill_GroupBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_GroupBy_361d_11_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: x => x.Category
- var i0_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_x, typeof(T0).GetProperty("Category")); // x.Category
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_x);
- return (global::ExpressiveSharp.IExpressiveQueryable>>)(object)
+ var i361d11c18_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
+ var i361d11c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d11c18_p_x, typeof(T0).GetProperty("Category")); // x.Category
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d11c18_expr_0, i361d11c18_p_x);
+ return (global::ExpressiveSharp.IExpressiveQueryable>)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.GroupBy(
(global::System.Linq.IQueryable)(object)source,
__lambda));
}
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_1(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: o => new { o.Id, o.Category }
- var i1_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
- var i1_expr_1 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Id")); // o.Id
- var i1_expr_2 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Category")); // o.Category
- var i1_expr_3 = typeof(T1).GetConstructors()[0];
- var i1_expr_0 = global::System.Linq.Expressions.Expression.New(i1_expr_3, new global::System.Linq.Expressions.Expression[] { i1_expr_1, i1_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Category") });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i1_expr_0, i1_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
+ var i361d10c18_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Id")); // o.Id
+ var i361d10c18_expr_2 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Category")); // o.Category
+ var i361d10c18_expr_3 = typeof(T1).GetConstructors()[0];
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.New(i361d10c18_expr_3, new global::System.Linq.Expressions.Expression[] { i361d10c18_expr_1, i361d10c18_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Category") });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.OrderByDescending_AfterAnonymousSelect_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.OrderByDescending_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
index 8a688991..80c4d161 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.OrderByDescending_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.OrderByDescending_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
@@ -3,17 +3,17 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_OrderByDescending_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_OrderByDescending_361d_11_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: x => x.Name
- var i0_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_x, typeof(T0).GetProperty("Name")); // x.Name
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_x);
+ var i361d11c18_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
+ var i361d11c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d11c18_p_x, typeof(T0).GetProperty("Name")); // x.Name
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d11c18_expr_0, i361d11c18_p_x);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.OrderByDescending(
@@ -21,17 +21,17 @@ namespace ExpressiveSharp.Generated.Interceptors
__lambda));
}
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_1(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: o => new { o.Id, o.Name }
- var i1_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
- var i1_expr_1 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Id")); // o.Id
- var i1_expr_2 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Name")); // o.Name
- var i1_expr_3 = typeof(T1).GetConstructors()[0];
- var i1_expr_0 = global::System.Linq.Expressions.Expression.New(i1_expr_3, new global::System.Linq.Expressions.Expression[] { i1_expr_1, i1_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Name") });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i1_expr_0, i1_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
+ var i361d10c18_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Id")); // o.Id
+ var i361d10c18_expr_2 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Name")); // o.Name
+ var i361d10c18_expr_3 = typeof(T1).GetConstructors()[0];
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.New(i361d10c18_expr_3, new global::System.Linq.Expressions.Expression[] { i361d10c18_expr_1, i361d10c18_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Name") });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Select_AfterAnonymousSelect_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Select_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
index 0a3bdd5c..cd82583a 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Select_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Select_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
@@ -3,17 +3,17 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_11_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: x => x.Id
- var i0_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_x, typeof(T0).GetProperty("Id")); // x.Id
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_x);
+ var i361d11c18_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
+ var i361d11c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d11c18_p_x, typeof(T0).GetProperty("Id")); // x.Id
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d11c18_expr_0, i361d11c18_p_x);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
@@ -21,17 +21,17 @@ namespace ExpressiveSharp.Generated.Interceptors
__lambda));
}
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_1(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: o => new { o.Id, o.Name }
- var i1_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
- var i1_expr_1 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Id")); // o.Id
- var i1_expr_2 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Name")); // o.Name
- var i1_expr_3 = typeof(T1).GetConstructors()[0];
- var i1_expr_0 = global::System.Linq.Expressions.Expression.New(i1_expr_3, new global::System.Linq.Expressions.Expression[] { i1_expr_1, i1_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Name") });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i1_expr_0, i1_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
+ var i361d10c18_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Id")); // o.Id
+ var i361d10c18_expr_2 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Name")); // o.Name
+ var i361d10c18_expr_3 = typeof(T1).GetConstructors()[0];
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.New(i361d10c18_expr_3, new global::System.Linq.Expressions.Expression[] { i361d10c18_expr_1, i361d10c18_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Name") });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Where_AfterAnonymousSelect_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Where_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
index d8a8283c..03aed038 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Where_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/AnonymousElementTests.Where_AfterAnonymousSelect_GeneratesInterceptor.verified.txt
@@ -3,19 +3,19 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Where_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Where_361d_11_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: x => x.Total > 100m
- var i0_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
- var i0_expr_1 = global::System.Linq.Expressions.Expression.Property(i0_p_x, typeof(T0).GetProperty("Total")); // x.Total
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Constant(100m, typeof(decimal)); // 100m
- var i0_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i0_expr_1, i0_expr_2);
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_x);
+ var i361d11c18_p_x = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "x");
+ var i361d11c18_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d11c18_p_x, typeof(T0).GetProperty("Total")); // x.Total
+ var i361d11c18_expr_2 = global::System.Linq.Expressions.Expression.Constant(100m, typeof(decimal)); // 100m
+ var i361d11c18_expr_0 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i361d11c18_expr_1, i361d11c18_expr_2);
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d11c18_expr_0, i361d11c18_p_x);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Where(
@@ -23,17 +23,17 @@ namespace ExpressiveSharp.Generated.Interceptors
__lambda));
}
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_1(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Select_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func)
{
// Source: o => new { o.Id, o.Total }
- var i1_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
- var i1_expr_1 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Id")); // o.Id
- var i1_expr_2 = global::System.Linq.Expressions.Expression.Property(i1_p_o, typeof(T0).GetProperty("Total")); // o.Total
- var i1_expr_3 = typeof(T1).GetConstructors()[0];
- var i1_expr_0 = global::System.Linq.Expressions.Expression.New(i1_expr_3, new global::System.Linq.Expressions.Expression[] { i1_expr_1, i1_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Total") });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i1_expr_0, i1_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(T0), "o");
+ var i361d10c18_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Id")); // o.Id
+ var i361d10c18_expr_2 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(T0).GetProperty("Total")); // o.Total
+ var i361d10c18_expr_3 = typeof(T1).GetConstructors()[0];
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.New(i361d10c18_expr_3, new global::System.Linq.Expressions.Expression[] { i361d10c18_expr_1, i361d10c18_expr_2 }, new global::System.Reflection.MemberInfo[] { typeof(T1).GetProperty("Id"), typeof(T1).GetProperty("Total") });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return (global::ExpressiveSharp.IExpressiveQueryable)(object)
global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.Select(
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.DistinctBy_WithComparer_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.DistinctBy_WithComparer_GeneratesInterceptor.verified.txt
index 455bf682..9802ff5d 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.DistinctBy_WithComparer_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.DistinctBy_WithComparer_GeneratesInterceptor.verified.txt
@@ -3,18 +3,18 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_DistinctBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_DistinctBy_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func,
global::System.Collections.Generic.IEqualityComparer comparer)
{
// Source: o => o.Tag
- var i0_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.DistinctBy(
(global::System.Linq.IQueryable)source,
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.GroupBy_WithComparer_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.GroupBy_WithComparer_GeneratesInterceptor.verified.txt
index 273e7cff..92b12979 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.GroupBy_WithComparer_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.GroupBy_WithComparer_GeneratesInterceptor.verified.txt
@@ -3,18 +3,18 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_GroupBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable> __Polyfill_GroupBy_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func,
global::System.Collections.Generic.IEqualityComparer comparer)
{
// Source: o => o.Tag
- var i0_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.GroupBy(
(global::System.Linq.IQueryable)source,
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.OrderBy_WithComparer_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.OrderBy_WithComparer_GeneratesInterceptor.verified.txt
index 7917f5a0..6e91a515 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.OrderBy_WithComparer_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ComparerOverloadTests.OrderBy_WithComparer_GeneratesInterceptor.verified.txt
@@ -3,18 +3,18 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_OrderBy_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_OrderBy_361d_10_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func __func,
global::System.Collections.Generic.IComparer comparer)
{
// Source: o => o.Tag
- var i0_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_0, i0_p_o);
+ var i361d10c18_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d10c18_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d10c18_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d10c18_expr_0, i361d10c18_p_o);
return global::ExpressiveSharp.ExpressiveQueryableExtensions.AsExpressive(
global::System.Linq.Queryable.OrderBy(
(global::System.Linq.IQueryable)source,
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdateAsync_GeneratesInterceptor.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdateAsync_GeneratesInterceptor.verified.txt
index 843bc37a..9ab6fa69 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdateAsync_GeneratesInterceptor.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdateAsync_GeneratesInterceptor.verified.txt
@@ -3,22 +3,22 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::System.Threading.Tasks.Task __Polyfill_ExecuteUpdateAsync_0(
+ internal static global::System.Threading.Tasks.Task __Polyfill_ExecuteUpdateAsync_361d_58_24(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func, global::TestNs.SetPropertyCalls> __func,
global::System.Threading.CancellationToken cancellationToken)
{
// Source: s => s.SetProperty(o => o.Tag, "updated")
- var i0_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
+ var i361d58c24_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
var p_o_1 = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o"); // o => o.Tag
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var i0_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_2, p_o_1);
- var i0_expr_4 = global::System.Linq.Expressions.Expression.Constant("updated", typeof(string)); // "updated"
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Call(i0_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericParameter && !m.GetParameters()[1].ParameterType.IsGenericType)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i0_expr_3, i0_expr_4 });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i0_expr_0, i0_p_s);
+ var i361d58c24_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var i361d58c24_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i361d58c24_expr_2, p_o_1);
+ var i361d58c24_expr_4 = global::System.Linq.Expressions.Expression.Constant("updated", typeof(string)); // "updated"
+ var i361d58c24_expr_0 = global::System.Linq.Expressions.Expression.Call(i361d58c24_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericParameter && !m.GetParameters()[1].ParameterType.IsGenericType)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i361d58c24_expr_3, i361d58c24_expr_4 });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i361d58c24_expr_0, i361d58c24_p_s);
return global::TestNs.MockRelationalExtensions.ExecuteUpdateAsync(
(global::System.Linq.IQueryable)source,
__lambda,
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_ConstantValue.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_ConstantValue.verified.txt
index 698d2895..7e54c4d2 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_ConstantValue.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_ConstantValue.verified.txt
@@ -3,21 +3,21 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static int __Polyfill_ExecuteUpdate_0(
+ internal static int __Polyfill_ExecuteUpdate_361d_58_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func, global::TestNs.SetPropertyCalls> __func)
{
// Source: s => s.SetProperty(o => o.Tag, "updated")
- var i0_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
+ var i361d58c18_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
var p_o_1 = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o"); // o => o.Tag
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var i0_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_2, p_o_1);
- var i0_expr_4 = global::System.Linq.Expressions.Expression.Constant("updated", typeof(string)); // "updated"
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Call(i0_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericParameter && !m.GetParameters()[1].ParameterType.IsGenericType)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i0_expr_3, i0_expr_4 });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i0_expr_0, i0_p_s);
+ var i361d58c18_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var i361d58c18_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i361d58c18_expr_2, p_o_1);
+ var i361d58c18_expr_4 = global::System.Linq.Expressions.Expression.Constant("updated", typeof(string)); // "updated"
+ var i361d58c18_expr_0 = global::System.Linq.Expressions.Expression.Call(i361d58c18_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericParameter && !m.GetParameters()[1].ParameterType.IsGenericType)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i361d58c18_expr_3, i361d58c18_expr_4 });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i361d58c18_expr_0, i361d58c18_p_s);
return global::TestNs.MockRelationalExtensions.ExecuteUpdate(
(global::System.Linq.IQueryable)source,
__lambda);
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithNullConditional.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithNullConditional.verified.txt
index a51e26ff..c35a09ff 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithNullConditional.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithNullConditional.verified.txt
@@ -3,30 +3,30 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static int __Polyfill_ExecuteUpdate_0(
+ internal static int __Polyfill_ExecuteUpdate_361d_63_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func, global::TestNs.SetPropertyCalls> __func)
{
// Source: s => s.SetProperty(o => o.Tag, o => o.Customer?.Name ?? "none")
- var i0_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
+ var i361d63c18_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
var p_o_1 = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o"); // o => o.Tag
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var i0_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_2, p_o_1);
+ var i361d63c18_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var i361d63c18_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i361d63c18_expr_2, p_o_1);
var p_o_4 = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o"); // o => o.Customer?.Name ?? "none"
- var i0_expr_6 = global::System.Linq.Expressions.Expression.Property(p_o_4, typeof(global::TestNs.Order).GetProperty("Customer")); // o.Customer
- var i0_expr_7 = global::System.Linq.Expressions.Expression.Property(i0_expr_6, typeof(global::TestNs.Customer).GetProperty("Name")); // .Name
- var i0_expr_9 = global::System.Linq.Expressions.Expression.Constant(null, typeof(global::TestNs.Customer));
- var i0_expr_10 = global::System.Linq.Expressions.Expression.NotEqual(i0_expr_6, i0_expr_9);
- var i0_expr_11 = global::System.Linq.Expressions.Expression.Default(typeof(string));
- var i0_expr_8 = global::System.Linq.Expressions.Expression.Condition(i0_expr_10, i0_expr_7, i0_expr_11, typeof(string));
- var i0_expr_12 = global::System.Linq.Expressions.Expression.Constant("none", typeof(string)); // "none"
- var i0_expr_5 = global::System.Linq.Expressions.Expression.Coalesce(i0_expr_8, i0_expr_12);
- var i0_expr_13 = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_5, p_o_4);
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Call(i0_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericType && !m.GetParameters()[1].ParameterType.IsGenericParameter)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i0_expr_3, i0_expr_13 });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i0_expr_0, i0_p_s);
+ var i361d63c18_expr_6 = global::System.Linq.Expressions.Expression.Property(p_o_4, typeof(global::TestNs.Order).GetProperty("Customer")); // o.Customer
+ var i361d63c18_expr_7 = global::System.Linq.Expressions.Expression.Property(i361d63c18_expr_6, typeof(global::TestNs.Customer).GetProperty("Name")); // .Name
+ var i361d63c18_expr_9 = global::System.Linq.Expressions.Expression.Constant(null, typeof(global::TestNs.Customer));
+ var i361d63c18_expr_10 = global::System.Linq.Expressions.Expression.NotEqual(i361d63c18_expr_6, i361d63c18_expr_9);
+ var i361d63c18_expr_11 = global::System.Linq.Expressions.Expression.Default(typeof(string));
+ var i361d63c18_expr_8 = global::System.Linq.Expressions.Expression.Condition(i361d63c18_expr_10, i361d63c18_expr_7, i361d63c18_expr_11, typeof(string));
+ var i361d63c18_expr_12 = global::System.Linq.Expressions.Expression.Constant("none", typeof(string)); // "none"
+ var i361d63c18_expr_5 = global::System.Linq.Expressions.Expression.Coalesce(i361d63c18_expr_8, i361d63c18_expr_12);
+ var i361d63c18_expr_13 = global::System.Linq.Expressions.Expression.Lambda>(i361d63c18_expr_5, p_o_4);
+ var i361d63c18_expr_0 = global::System.Linq.Expressions.Expression.Call(i361d63c18_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericType && !m.GetParameters()[1].ParameterType.IsGenericParameter)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i361d63c18_expr_3, i361d63c18_expr_13 });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i361d63c18_expr_0, i361d63c18_p_s);
return global::TestNs.MockRelationalExtensions.ExecuteUpdate(
(global::System.Linq.IQueryable)source,
__lambda);
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithSwitchExpression.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithSwitchExpression.verified.txt
index 137849a7..86cb1247 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithSwitchExpression.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/ExecuteUpdateTests.ExecuteUpdate_SetProperty_WithSwitchExpression.verified.txt
@@ -3,32 +3,32 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static int __Polyfill_ExecuteUpdate_0(
+ internal static int __Polyfill_ExecuteUpdate_361d_62_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func, global::TestNs.SetPropertyCalls> __func)
{
// Source: s => s.SetProperty(o => o.Tag, o => o.Amount switch { > 100 => "high", > 50 => "medium", _ => "low" })
- var i0_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
+ var i361d62c18_p_s = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.SetPropertyCalls), "s");
var p_o_1 = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o"); // o => o.Tag
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var i0_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_2, p_o_1);
+ var i361d62c18_expr_2 = global::System.Linq.Expressions.Expression.Property(p_o_1, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var i361d62c18_expr_3 = global::System.Linq.Expressions.Expression.Lambda>(i361d62c18_expr_2, p_o_1);
var p_o_4 = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o"); // o => o.Amount switch { ...
- var i0_expr_5 = global::System.Linq.Expressions.Expression.Property(p_o_4, typeof(global::TestNs.Order).GetProperty("Amount")); // o.Amount
- var i0_expr_6 = global::System.Linq.Expressions.Expression.Constant("low", typeof(string)); // "low"
- var i0_expr_8 = global::System.Linq.Expressions.Expression.Constant(50, typeof(int)); // 50
- var i0_expr_7 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i0_expr_5, i0_expr_8);
- var i0_expr_9 = global::System.Linq.Expressions.Expression.Constant("medium", typeof(string)); // "medium"
- var i0_expr_10 = global::System.Linq.Expressions.Expression.Condition(i0_expr_7, i0_expr_9, i0_expr_6, typeof(string));
- var i0_expr_12 = global::System.Linq.Expressions.Expression.Constant(100, typeof(int)); // 100
- var i0_expr_11 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i0_expr_5, i0_expr_12);
- var i0_expr_13 = global::System.Linq.Expressions.Expression.Constant("high", typeof(string)); // "high"
- var i0_expr_14 = global::System.Linq.Expressions.Expression.Condition(i0_expr_11, i0_expr_13, i0_expr_10, typeof(string));
- var i0_expr_15 = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_14, p_o_4);
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Call(i0_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericType && !m.GetParameters()[1].ParameterType.IsGenericParameter)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i0_expr_3, i0_expr_15 });
- var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i0_expr_0, i0_p_s);
+ var i361d62c18_expr_5 = global::System.Linq.Expressions.Expression.Property(p_o_4, typeof(global::TestNs.Order).GetProperty("Amount")); // o.Amount
+ var i361d62c18_expr_6 = global::System.Linq.Expressions.Expression.Constant("low", typeof(string)); // "low"
+ var i361d62c18_expr_8 = global::System.Linq.Expressions.Expression.Constant(50, typeof(int)); // 50
+ var i361d62c18_expr_7 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i361d62c18_expr_5, i361d62c18_expr_8);
+ var i361d62c18_expr_9 = global::System.Linq.Expressions.Expression.Constant("medium", typeof(string)); // "medium"
+ var i361d62c18_expr_10 = global::System.Linq.Expressions.Expression.Condition(i361d62c18_expr_7, i361d62c18_expr_9, i361d62c18_expr_6, typeof(string));
+ var i361d62c18_expr_12 = global::System.Linq.Expressions.Expression.Constant(100, typeof(int)); // 100
+ var i361d62c18_expr_11 = global::System.Linq.Expressions.Expression.MakeBinary(global::System.Linq.Expressions.ExpressionType.GreaterThan, i361d62c18_expr_5, i361d62c18_expr_12);
+ var i361d62c18_expr_13 = global::System.Linq.Expressions.Expression.Constant("high", typeof(string)); // "high"
+ var i361d62c18_expr_14 = global::System.Linq.Expressions.Expression.Condition(i361d62c18_expr_11, i361d62c18_expr_13, i361d62c18_expr_10, typeof(string));
+ var i361d62c18_expr_15 = global::System.Linq.Expressions.Expression.Lambda>(i361d62c18_expr_14, p_o_4);
+ var i361d62c18_expr_0 = global::System.Linq.Expressions.Expression.Call(i361d62c18_p_s, global::System.Linq.Enumerable.First(global::System.Linq.Enumerable.Where(typeof(global::TestNs.SetPropertyCalls).GetMethods(global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance), m => m.Name == "SetProperty" && m.IsGenericMethodDefinition && m.GetGenericArguments().Length == 1 && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType.IsGenericType && !m.GetParameters()[0].ParameterType.IsGenericParameter && m.GetParameters()[1].ParameterType.IsGenericType && !m.GetParameters()[1].ParameterType.IsGenericParameter)).MakeGenericMethod(typeof(string)), new global::System.Linq.Expressions.Expression[] { i361d62c18_expr_3, i361d62c18_expr_15 });
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda, global::TestNs.SetPropertyCalls>>(i361d62c18_expr_0, i361d62c18_p_s);
return global::TestNs.MockRelationalExtensions.ExecuteUpdate(
(global::System.Linq.IQueryable)source,
__lambda);
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Polyfill_GlobalNullConditionalIgnore_UsesIgnoreMode.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Polyfill_GlobalNullConditionalIgnore_UsesIgnoreMode.verified.txt
index f12f9667..12da718b 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Polyfill_GlobalNullConditionalIgnore_UsesIgnoreMode.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Polyfill_GlobalNullConditionalIgnore_UsesIgnoreMode.verified.txt
@@ -3,22 +3,22 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::System.Linq.Expressions.Expression> __Polyfill_Create_0(
+ internal static global::System.Linq.Expressions.Expression> __Polyfill_Create_361d_9_68(
global::System.Func __func)
{
// Source: o => o.Tag?.Length
- var i0_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
- var i0_expr_0 = global::System.Linq.Expressions.Expression.Property(i0_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
- var i0_expr_1 = global::System.Linq.Expressions.Expression.Property(i0_expr_0, typeof(string).GetProperty("Length")); // .Length
- var i0_expr_2 = global::System.Linq.Expressions.Expression.Convert(i0_expr_1, typeof(int?));
- var i0_expr_4 = global::System.Linq.Expressions.Expression.Constant(null, typeof(string));
- var i0_expr_5 = global::System.Linq.Expressions.Expression.NotEqual(i0_expr_0, i0_expr_4);
- var i0_expr_6 = global::System.Linq.Expressions.Expression.Default(typeof(int?));
- var i0_expr_3 = global::System.Linq.Expressions.Expression.Condition(i0_expr_5, i0_expr_2, i0_expr_6, typeof(int?));
- var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i0_expr_3, i0_p_o);
+ var i361d9c68_p_o = global::System.Linq.Expressions.Expression.Parameter(typeof(global::TestNs.Order), "o");
+ var i361d9c68_expr_0 = global::System.Linq.Expressions.Expression.Property(i361d9c68_p_o, typeof(global::TestNs.Order).GetProperty("Tag")); // o.Tag
+ var i361d9c68_expr_1 = global::System.Linq.Expressions.Expression.Property(i361d9c68_expr_0, typeof(string).GetProperty("Length")); // .Length
+ var i361d9c68_expr_2 = global::System.Linq.Expressions.Expression.Convert(i361d9c68_expr_1, typeof(int?));
+ var i361d9c68_expr_4 = global::System.Linq.Expressions.Expression.Constant(null, typeof(string));
+ var i361d9c68_expr_5 = global::System.Linq.Expressions.Expression.NotEqual(i361d9c68_expr_0, i361d9c68_expr_4);
+ var i361d9c68_expr_6 = global::System.Linq.Expressions.Expression.Default(typeof(int?));
+ var i361d9c68_expr_3 = global::System.Linq.Expressions.Expression.Condition(i361d9c68_expr_5, i361d9c68_expr_2, i361d9c68_expr_6, typeof(int?));
+ var __lambda = global::System.Linq.Expressions.Expression.Lambda>(i361d9c68_expr_3, i361d9c68_p_o);
return __lambda;
}
}
diff --git a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Where_GlobalNullConditionalRewrite_AppliesWithoutPerCallOverride.verified.txt b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Where_GlobalNullConditionalRewrite_AppliesWithoutPerCallOverride.verified.txt
index 6efbf965..ed6c8195 100644
--- a/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Where_GlobalNullConditionalRewrite_AppliesWithoutPerCallOverride.verified.txt
+++ b/tests/ExpressiveSharp.Generator.Tests/PolyfillInterceptorGenerator/GlobalOptionsTests.Where_GlobalNullConditionalRewrite_AppliesWithoutPerCallOverride.verified.txt
@@ -3,24 +3,24 @@
namespace ExpressiveSharp.Generated.Interceptors
{
- internal static class PolyfillInterceptors
+ internal static partial class PolyfillInterceptors
{
[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(/* scrubbed */)]
- internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Where_0(
+ internal static global::ExpressiveSharp.IExpressiveQueryable __Polyfill_Where_361d_11_18(
this global::ExpressiveSharp.IExpressiveQueryable source,
global::System.Func