diff --git a/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithMultipleParameter.verified.txt b/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithMultipleParameter.verified.txt
index c0d8271..f801f55 100644
--- a/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithMultipleParameter.verified.txt
+++ b/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithMultipleParameter.verified.txt
@@ -8,21 +8,23 @@ namespace Backgrounder.Sample
///
public static partial class SampleJobMultipleParameterExtensions
{
+ public record MultipleParameterMessageXEWDF(int? jobId, string? name);
+
///
/// Enqueue the method public Task DoWork(int?, string?) for execution in the background
///
public static async global::System.Threading.Tasks.Task MultipleParameter(this global::Backgrounder.IBackgrounder backgrounder, int? jobId, string? name)
{
- var parameterTuple = new global::System.Tuple(jobId, name);
- await backgrounder.EnqueueAsync("public Task DoWork(int?, string?)", parameterTuple);
+ var methodParameters = new MultipleParameterMessageXEWDF(jobId, name);
+ await backgrounder.EnqueueAsync("public Task DoWork(int?, string?)", methodParameters);
}
internal static async global::System.Threading.Tasks.Task ExecuteMultipleParameterXEWDF(global::System.IServiceProvider serviceProvider, byte[] messageBody)
{
- var messageSerializer = serviceProvider.GetRequiredService();
- var methodParameters = messageSerializer.Deserialize>(messageBody);
- var worker = serviceProvider.GetRequiredService();
- await worker.MultipleParameter(methodParameters.Item1, methodParameters.Item2);
+ var messageSerializer = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(serviceProvider);
+ var methodParameters = messageSerializer.Deserialize(messageBody);
+ var worker = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(serviceProvider);
+ await worker.MultipleParameter(methodParameters.jobId, methodParameters.name);
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
diff --git a/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithOneParameter.verified.txt b/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithOneParameter.verified.txt
index 74259eb..bc65d24 100644
--- a/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithOneParameter.verified.txt
+++ b/test/Backgrounder.Generators.Tests/Snapshots/BackgroundWriterTests.GenerateWithOneParameter.verified.txt
@@ -8,21 +8,23 @@ namespace Backgrounder.Sample
///
public static partial class SampleJobDoWorkExtensions
{
+ public record DoWorkMessageABCD(int? jobId);
+
///
/// Enqueue the method public Task DoWork(int?) for execution in the background
///
public static async global::System.Threading.Tasks.Task DoWork(this global::Backgrounder.IBackgrounder backgrounder, int? jobId)
{
- var parameterTuple = new global::System.Tuple(jobId);
- await backgrounder.EnqueueAsync("public Task DoWork(int?)", parameterTuple);
+ var methodParameters = new DoWorkMessageABCD(jobId);
+ await backgrounder.EnqueueAsync("public Task DoWork(int?)", methodParameters);
}
internal static async global::System.Threading.Tasks.Task ExecuteDoWorkABCD(global::System.IServiceProvider serviceProvider, byte[] messageBody)
{
- var messageSerializer = serviceProvider.GetRequiredService();
- var methodParameters = messageSerializer.Deserialize>(messageBody);
- var worker = serviceProvider.GetRequiredService();
- await worker.DoWork(methodParameters.Item1);
+ var messageSerializer = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(serviceProvider);
+ var methodParameters = messageSerializer.Deserialize(messageBody);
+ var worker = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(serviceProvider);
+ await worker.DoWork(methodParameters.jobId);
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]