Update aspnetcore patch

This commit is contained in:
Logan Bussell 2022-06-30 10:03:32 -07:00
parent c6a8b2fa24
commit 33743c8b9d
No known key found for this signature in database
GPG key ID: A6785347D2834033

View file

@ -24,14 +24,14 @@ index ca52bd1f40..643d03e8af 100644
// There's no way to to register multiple service types per definition. See https://github.com/aspnet/DependencyInjection/issues/360
-#pragma warning disable CS8634 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'class' constraint.
- _applicationServiceCollection.AddSingleton(services
- => services.GetService<ApplicationLifetime>() as IHostApplicationLifetime);
- => services.GetService<ApplicationLifetime>()! as IHostApplicationLifetime);
+ _applicationServiceCollection.AddSingleton<IHostApplicationLifetime>(services
+ => services.GetService<ApplicationLifetime>()!);
#pragma warning disable CS0618 // Type or member is obsolete
- _applicationServiceCollection.AddSingleton(services
- => services.GetService<ApplicationLifetime>() as AspNetCore.Hosting.IApplicationLifetime);
- => services.GetService<ApplicationLifetime>()! as AspNetCore.Hosting.IApplicationLifetime);
- _applicationServiceCollection.AddSingleton(services
- => services.GetService<ApplicationLifetime>() as Extensions.Hosting.IApplicationLifetime);
- => services.GetService<ApplicationLifetime>()! as Extensions.Hosting.IApplicationLifetime);
+ _applicationServiceCollection.AddSingleton<AspNetCore.Hosting.IApplicationLifetime>(services
+ => services.GetService<ApplicationLifetime>()!);
+ _applicationServiceCollection.AddSingleton<Extensions.Hosting.IApplicationLifetime>(services