Last active
May 31, 2020 22:55
-
-
Save changhuixu/7a5c0bdf163dcdb9bdda93ea7f8b0ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime hostApplicationLifetime) | |
| { | |
| // ... | |
| hostApplicationLifetime.ApplicationStarted.Register(() => { }); | |
| hostApplicationLifetime.ApplicationStopping.Register(() => | |
| { | |
| var rabbitMqClient = app.ApplicationServices.GetRequiredService<IRabbitMQClient>(); | |
| rabbitMqClient.CloseConnection(); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment