EventStore / EventStore-Client-Dotnet

Dotnet Client SDK for the Event Store gRPC Client API written in C#
Other
140 stars 38 forks source link

Added 3 overloads of `AddEventStoreClient` #238

Closed NielsPilgaard closed 1 year ago

NielsPilgaard commented 1 year ago

Hi there 👋

This PR adds 3 new overloads of AddEventStoreClient that provide access to the IServiceProvider, 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.

NielsPilgaard commented 1 year ago

I submitted a fix for the Client development project automations for pull requests test failure: https://github.com/EventStore/Automations/pull/70 😊

NielsPilgaard commented 1 year ago

The PR linked above has been merged, so Client development project automations for pull requests ought to work now :)

NielsPilgaard commented 1 year ago

The publish workflow failed, commit https://github.com/EventStore/EventStore-Client-Dotnet/pull/238/commits/5f606de1dfe7544bd8e9b6d9d3fb25d77a16a7d9 in this PR ought to fix it though :)

NielsPilgaard commented 1 year ago

Both tests seem to fail because net5.0 is out of support: https://github.com/EventStore/EventStore-Client-Dotnet/actions/runs/4196973516/jobs/7353436139#step:6:26 https://github.com/EventStore/EventStore-Client-Dotnet/actions/runs/4196973522/jobs/7353440994#step:7:43

If you'd like I could remove net5.0 from the various actions.

alexeyzimarev commented 1 year ago

If you'd like I could remove net5.0 from the various actions.

That would be great!

thefringeninja commented 1 year ago

@NielsPilgaard we'll remove net5 in a separate PR

NielsPilgaard commented 1 year ago

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.

NielsPilgaard commented 1 year ago

I've committed a fix for my newest pipeline bug 😅 the packages folder is now created if it doesn't exist, just before running dotnet pack.