Depending on your deployment topology, you might need to use different methods to connect to your EventStoreDB server or cluster. The following pages cover this in details:
You can also register the
EventStoreClient instance in the Microsoft ASP.NET Core DI container by using extension methods provided by the SDK.
For advanced scenarios you might want to add a middleware in the gRPC message handling pipeline using an interceptor.