Expose IServiceProvider on DistributedApplicationExecutionContext.#4668
Expose IServiceProvider on DistributedApplicationExecutionContext.#4668
Conversation
| public IServiceProvider ServiceProvider | ||
| { | ||
| get =>_serviceProvider ?? throw new InvalidOperationException("The ServiceProvider has not been set."); | ||
| internal set => _serviceProvider = value; |
There was a problem hiding this comment.
This probably won't be able to stay internal because it makes it impossible to unit test easily.
There was a problem hiding this comment.
It can't be internal, then you can't write tests for it.
|
I think you need another constructor. It could take both arguments: DistributedApplicationOperation and IServiceProvider. But that doesn't scale. Or you could create an options type, e.g. |
|
@JamesNK pretty much went with your proposal here. |
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=726046&view=codecoverage-tab |
Experimenting with exposing
IServiceProviderviaDistributedApplicationExecutionContextwith minimal API breaking changes.Microsoft Reviewers: Open in CodeFlow