Commit 03213fc
committed
Refactor HostApplicationLifetime retrieval and registration
Simplified and improved the retrieval and registration of the
HostApplicationLifetime service in BotApp.cs and BotBuilder.cs.
In BotApp.cs, the code now retrieves IHostApplicationLifetime
and casts it to HostApplicationLifetime, throwing an
InvalidOperationException if the cast fails. In BotBuilder.cs,
the registration of HostApplicationLifetime has been simplified
by removing the factory method and directly registering the
service. These changes enhance the robustness and clarity of
the code.1 parent 5ab4360 commit 03213fc
2 files changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | | - | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments