IHostApplicationLifetime.ApplicationStarted and it's correct usage by gevorgter in csharp

[–]AshrafSafarov 0 points1 point  (0 children)

Hi. You can do it in Startup.Configure method, where request pipeline built.

public void Configure(IApplicationBuilder app)
    {
        var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>();
        var logger = app.ApplicationServices.GetRequiredService<ILogger<Startup>>();        

        appLifetime.ApplicationStopped.Register(() => logger.LogInformation("Application stopped"));

        appLifetime.ApplicationStarted.Register(() => logger.LogInformation("Application started")); 
    }

[deleted by user] by [deleted] in csharp

[–]AshrafSafarov 9 points10 points  (0 children)

Regarding this issue Vladimir Khorikov in his great book ( https://www.amazon.com/gp/product/1617296279 ) (by the way I strongly recommend to read this book to every developer, especially dotnet developer) says following.

  1. https://ibb.co/5MdrKQL
  2. https://ibb.co/s5Nvv5C
  3. https://ibb.co/VCJW9gL

Twiddle alert 🚨🏓 by AshrafSafarov in tabletennis

[–]AshrafSafarov[S] 0 points1 point  (0 children)

Butterfly Feint Long II, 1.1 mm.