lith hace 4 años
padre
commit
93def89dab
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  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();
                     }
                 };