-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added 3 overloads of AddEventStoreClient
#238
Added 3 overloads of AddEventStoreClient
#238
Conversation
These new methods provide access to the `IServiceProvider`, allowing easy configuration across environments. This is very useful when using EventStore on different environments, that use different EventStores. I currently have this code running in production, and it works very well in combination with a configuration manager such as Azure App Configuration, or Azure Key Vault. They allow constructing the following using the ServiceProvider: - Uri address - string connectionString - Action<EventStoreClientSettings` configureSettings I've also added: - 2 new private methods that do the actual registration - tests for all 3 public methods
I submitted a fix for the Client development project automations for pull requests test failure: EventStore/Automations#70 😊 |
The PR linked above has been merged, so |
test/EventStore.Client.Streams.Tests/DependencyInjectionTests.cs
Outdated
Show resolved
Hide resolved
Also renamed tests to be more human-readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great, thanks very much!
This fixes publish failing with the error `error NETSDK1194: The "--output" option isn't supported when building a solution.` The `--output` flag has been deprecated, the recommended approach is to use `/p:PublishDir=..` instead. Reference: dotnet/performance#2774
The publish workflow failed, commit 5f606de in this PR ought to fix it though :) |
Both tests seem to fail because If you'd like I could remove |
That would be great! |
@NielsPilgaard we'll remove net5 in a separate PR |
Alrighty 👍 I wouldn't mind making that PR either, but I totally understand if you'd prefer a change like that to be made in-house. |
I've committed a fix for my newest pipeline bug 😅 the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publishing artifacts will probably fail but we can address that in a future PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hi there 👋
This PR adds 3 new overloads of
AddEventStoreClient
that provide access to theIServiceProvider
, allowing easy configuration across environments. This is very useful when using EventStore on different environments, that use different EventStores.They allow constructing the following using the ServiceProvider:
I've also added:
I currently have one of these extension methods running in production, and it works very well in combination with a configuration manager such as Azure App Configuration, or Azure Key Vault.