lith 4 years ago
parent
commit
93def89dab
1 changed files with 2 additions and 3 deletions
  1. 2 3
      dotnet/ServiceStation/ApiLoader/Sers.Serslot/SerslotServer.cs

+ 2 - 3
dotnet/ServiceStation/ApiLoader/Sers.Serslot/SerslotServer.cs

@@ -283,9 +283,8 @@ namespace Sers.Serslot
                 ServiceStation.ServiceStation.Init();
                 Sers.Core.Module.App.SersApplication.onStop += () => 
                 {
-                    IApplicationLifetime lifetime = serviceProvider.GetService(typeof(IApplicationLifetime)) as IApplicationLifetime;
-
-                    if (lifetime != null) {
+                    if (serviceProvider.GetService(typeof(IApplicationLifetime)) is IApplicationLifetime lifetime)
+                    {
                         lifetime.StopApplication();
                     }
                 };