Skip to content

Commit

Permalink
Disable CS8321 warning for generated code, unused local function (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed Mar 1, 2023
1 parent 30ceab4 commit 0f51c3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// </auto-generated>

#pragma warning disable CS8019 // Unused usings
#pragma warning disable CS8321 // Unused local function

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
Expand Down Expand Up @@ -93,7 +94,7 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddSingleton<Dummy>();

return services;

{{~ if HasNotifications ~}}
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
static global::System.Func<global::System.IServiceProvider, T> GetRequiredService<T>() where T : notnull => sp => sp.GetRequiredService<T>();
Expand Down Expand Up @@ -202,7 +203,7 @@ namespace {{ MediatorNamespace }}
_getServicesLength = sp.GetServices<global::Microsoft.Extensions.DependencyInjection.MediatorDependencyInjectionExtensions.Dummy>() is global::Microsoft.Extensions.DependencyInjection.MediatorDependencyInjectionExtensions.Dummy[]
? (s => ((object[])s).Length) : (s => s.Count());
}

{{~ if ServiceLifetimeIsSingleton ~}}
{{ if IsTestRun }}internal{{ else }}private{{ end }} struct FastLazyValue<T>
where T : struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// </auto-generated>

#pragma warning disable CS8019 // Unused usings
#pragma warning disable CS8321 // Unused local function

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
Expand All @@ -16,12 +17,13 @@ namespace Microsoft.Extensions.DependencyInjection
/// DI extensions for Mediator.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Mediator.SourceGenerator", "{{ GeneratorVersion }}")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public static class MediatorDependencyInjectionExtensions
{
/// <summary>
/// Adds the Mediator implementation and handlers of your application.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static IServiceCollection AddMediator(this IServiceCollection services)
{
return AddMediator(services, null);
Expand All @@ -32,7 +34,6 @@ namespace Microsoft.Extensions.DependencyInjection
/// <summary>
/// Adds the Mediator implementation and handlers of your application, with specified options.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static IServiceCollection AddMediator(this IServiceCollection services, global::System.Action<global::Mediator.MediatorOptions> options)
{
services.AddSingleton<Dummy>();
Expand Down

0 comments on commit 0f51c3a

Please sign in to comment.