Skip to content

Commit

Permalink
support IAsyncDIsposable
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Apr 7, 2021
1 parent 22a073b commit 8932db8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ConsoleAppFramework/ConsoleAppEngineService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ public async Task StopAsync(CancellationToken cancellationToken)
}
finally
{
scope.Dispose();
if (scope is IAsyncDisposable asyncDisposable)
{
await asyncDisposable.DisposeAsync();
}
else
{
scope.Dispose();
}
}
}
}
Expand Down

0 comments on commit 8932db8

Please sign in to comment.