diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml
index c4efd3227..4023569e8 100644
--- a/.github/workflows/base.yml
+++ b/.github/workflows/base.yml
@@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- framework: [ net9.0 ]
+ framework: [ net8.0, net9.0 ]
os: [ ubuntu-latest ]
configuration: [ release ]
runs-on: ${{ matrix.os }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index ebe348e3e..0aabc306f 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -1,193 +1,200 @@
-#name: Publish
-#
-#on:
-# pull_request:
-# push:
-# branches:
-# - master
-# tags:
-# - v*
-#
-#jobs:
-# vulnerability-scan:
-# timeout-minutes: 10
-# strategy:
-# fail-fast: false
-# matrix:
-# framework: [ net8.0 ]
-# os: [ ubuntu-latest, windows-latest ]
-# runs-on: ${{ matrix.os }}
-# name: scan-vulnerabilities/${{ matrix.os }}/${{ matrix.framework }}
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
-# - name: Install dotnet SDKs
-# uses: actions/setup-dotnet@v3
-# with:
-# dotnet-version: |
-# 8.0.x
-# - name: Scan for Vulnerabilities
-# shell: bash
-# run: |
-# dotnet nuget list source
-# dotnet restore
-# dotnet list package --vulnerable --include-transitive --framework ${{ matrix.framework }} | tee vulnerabilities.txt
-# ! cat vulnerabilities.txt | grep -q "has the following vulnerable packages"
-#
-# build-samples:
-# timeout-minutes: 5
-# name: build-samples/${{ matrix.framework }}
-# runs-on: ubuntu-latest
-# strategy:
-# fail-fast: false
-# matrix:
-# framework: [ net8.0 ]
-# services:
-# esdb:
-# image: docker.eventstore.com/eventstore-ce/eventstoredb-ce:lts
-# env:
-# EVENTSTORE_INSECURE: true
-# EVENTSTORE_MEM_DB: false
-# EVENTSTORE_RUN_PROJECTIONS: all
-# EVENTSTORE_START_STANDARD_PROJECTIONS: true
-# ports:
-# - 2113:2113
-# options: --health-cmd "exit 0"
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
-# - name: Install dotnet SDKs
-# uses: actions/setup-dotnet@v3
-# with:
-# dotnet-version: |
-# 8.0.x
-# - name: Compile
-# shell: bash
-# run: |
-# dotnet build samples
-# - name: Run
-# shell: bash
-# run: |
-# find samples/ -type f -iname "*.csproj" -print0 | xargs -0L1 dotnet run --framework ${{ matrix.framework }} --project
-#
-# generate-certificates:
-# runs-on: ubuntu-latest
-# steps:
-# - name: Checkout code
-# uses: actions/checkout@v4
-# - name: Generate certificates
-# run: |
-# mkdir -p certs
-# docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-ca -out /tmp/ca
-# docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-node -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/node -ip-addresses 127.0.0.1 -dns-names localhost
-# docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username admin -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-admin
-# docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username invalid -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-invalid
-# - name: Set permissions on certificates
-# run: |
-# sudo chown -R $USER:$USER certs
-# sudo chmod -R 755 certs
-# - name: Upload certificates
-# uses: actions/upload-artifact@v4
-# with:
-# name: certs
-# path: certs
-#
-# test:
-# needs: generate-certificates
-# timeout-minutes: 20
-# strategy:
-# fail-fast: false
-# matrix:
-# framework: [ net8.0 ]
-# os: [ ubuntu-latest, windows-latest ]
-# configuration: [ release ]
-# runs-on: ${{ matrix.os }}
-# name: test/EventStore.Client/${{ matrix.os }}/${{ matrix.framework }}
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
-# - shell: bash
-# run: |
-# git fetch --prune --unshallow
-# - name: Install dotnet SDKs
-# uses: actions/setup-dotnet@v3
-# with:
-# dotnet-version: |
-# 8.0.x
-# - name: Compile
-# shell: bash
-# run: |
-# dotnet build --configuration ${{ matrix.configuration }} --framework ${{ matrix.framework }} src/EventStore.Client
-# - name: Download certificates
-# uses: actions/download-artifact@v4
-# with:
-# name: certs
-# path: certs
-# - name: Run Tests (Linux)
-# if: runner.os == 'Linux'
-# shell: bash
-# run: |
-# dotnet test --configuration ${{ matrix.configuration }} --blame \
-# --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \
-# --framework ${{ matrix.framework }} \
-# test/EventStore.Client.Tests
-# - name: Run Tests (Windows)
-# if: runner.os == 'Windows'
-# shell: pwsh
-# run: |
-# dotnet test --configuration ${{ matrix.configuration }} --blame `
-# --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" `
-# --framework ${{ matrix.framework }} `
-# test/EventStore.Client.Tests
-#
-# publish:
-# timeout-minutes: 5
-# needs: [ vulnerability-scan, test, build-samples ]
-# runs-on: ubuntu-latest
-# name: publish
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
-# - name: Get Version
-# id: get_version
-# run: |
-# echo "branch=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
-# dotnet nuget list source
-# dotnet tool restore
-# version=$(dotnet tool run minver -- --tag-prefix=v)
-# echo "version=${version}" >> $GITHUB_OUTPUT
-# - shell: bash
-# run: |
-# git fetch --prune --unshallow
-# - name: Install dotnet SDKs
-# uses: actions/setup-dotnet@v3
-# with:
-# dotnet-version: |
-# 8.0.x
-# - name: Dotnet Pack
-# shell: bash
-# run: |
-# mkdir -p packages
-# dotnet pack /p:Version=${{ steps.get_version.outputs.version }} --configuration=Release \
-# /p:PublishDir=./packages \
-# /p:NoWarn=NU5105 \
-# /p:RepositoryUrl=https://github.com/EventStore/EventStore-Client-Dotnet \
-# /p:RepositoryType=git
-# - name: Publish Artifacts
-# uses: actions/upload-artifact@v4
-# with:
-# path: packages
-# name: nuget-packages
-# - name: Dotnet Push to Github Packages
-# shell: bash
-# if: github.event_name == 'push'
-# run: |
-# dotnet tool restore
-# find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.github_token }} --source https://nuget.pkg.github.com/EventStore/index.json --skip-duplicate
-# - name: Dotnet Push to Nuget.org
-# shell: bash
-# if: contains(steps.get_version.outputs.branch, 'v')
-# run: |
-# dotnet nuget list source
-# dotnet tool restore
-# find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.nuget_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate
+name: Publish
+
+on:
+ pull_request:
+ push:
+ branches:
+ - master
+ tags:
+ - v*
+
+jobs:
+ vulnerability-scan:
+ timeout-minutes: 10
+ strategy:
+ fail-fast: false
+ matrix:
+ framework: [ net8.0, net9.0 ]
+ os: [ ubuntu-latest, windows-latest ]
+ runs-on: ${{ matrix.os }}
+ name: scan-vulnerabilities/${{ matrix.os }}/${{ matrix.framework }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Install dotnet SDKs
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Scan for Vulnerabilities
+ shell: bash
+ run: |
+ dotnet nuget list source
+ dotnet restore
+ dotnet list package --vulnerable --include-transitive --framework ${{ matrix.framework }} | tee vulnerabilities.txt
+ ! cat vulnerabilities.txt | grep -q "has the following vulnerable packages"
+
+ build-samples:
+ timeout-minutes: 5
+ name: build-samples/${{ matrix.framework }}
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ framework: [ net8.0, net9.0 ]
+ services:
+ esdb:
+ image: docker.eventstore.com/eventstore-ce/eventstoredb-ce:lts
+ env:
+ EVENTSTORE_INSECURE: true
+ EVENTSTORE_MEM_DB: false
+ EVENTSTORE_RUN_PROJECTIONS: all
+ EVENTSTORE_START_STANDARD_PROJECTIONS: true
+ ports:
+ - 2113:2113
+ options: --health-cmd "exit 0"
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Install dotnet SDKs
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Compile
+ shell: bash
+ run: |
+ dotnet build samples
+ - name: Run
+ shell: bash
+ run: |
+ find samples/ -type f -iname "*.csproj" -print0 | xargs -0L1 dotnet run --framework ${{ matrix.framework }} --project
+
+ generate-certificates:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ - name: Generate certificates
+ run: |
+ mkdir -p certs
+ docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-ca -out /tmp/ca
+ docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-node -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/node -ip-addresses 127.0.0.1 -dns-names localhost
+ docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username admin -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-admin
+ docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username invalid -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-invalid
+ - name: Set permissions on certificates
+ run: |
+ sudo chown -R $USER:$USER certs
+ sudo chmod -R 755 certs
+ - name: Upload certificates
+ uses: actions/upload-artifact@v4
+ with:
+ name: certs
+ path: certs
+
+ test:
+ needs: generate-certificates
+ timeout-minutes: 10
+ strategy:
+ fail-fast: false
+ matrix:
+ framework: [ net8.0, 9.0 ]
+ os: [ ubuntu-latest, windows-latest ]
+ configuration: [ release ]
+ test: [ Streams, PersistentSubscriptions, Operations, ProjectionManagement, UserManagement, Security, Misc ]
+ runs-on: ${{ matrix.os }}
+ name: ${{ inputs.test }} (${{ matrix.os }}, ${{ matrix.framework }})
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - shell: bash
+ run: |
+ git fetch --prune --unshallow
+ - name: Install dotnet SDKs
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Compile
+ shell: bash
+ run: |
+ dotnet build --configuration ${{ matrix.configuration }} --framework ${{ matrix.framework }} src/Kurrent.Client
+ - name: Download certificates
+ uses: actions/download-artifact@v4
+ with:
+ name: certs
+ path: certs
+ - name: Run Tests (Linux)
+ if: runner.os == 'Linux'
+ shell: bash
+ run: |
+ dotnet test --configuration ${{ matrix.configuration }} --blame \
+ --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \
+ --filter "Category=Target:${{ inputs.test }}" \
+ --framework ${{ matrix.framework }} \
+ test/Kurrent.Client.Tests
+ - name: Run Tests (Windows)
+ if: runner.os == 'Windows'
+ shell: pwsh
+ run: |
+ dotnet test --configuration ${{ matrix.configuration }} --blame `
+ --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" `
+ --framework ${{ matrix.framework }} `
+ --filter "Category=Target:${{ inputs.test }}" `
+ test/Kurrent.Client.Tests
+
+ publish:
+ timeout-minutes: 5
+ needs: [ vulnerability-scan, test, build-samples ]
+ runs-on: ubuntu-latest
+ name: publish
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Get Version
+ id: get_version
+ run: |
+ echo "branch=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
+ dotnet nuget list source
+ dotnet tool restore
+ version=$(dotnet tool run minver -- --tag-prefix=v)
+ echo "version=${version}" >> $GITHUB_OUTPUT
+ - shell: bash
+ run: |
+ git fetch --prune --unshallow
+ - name: Install dotnet SDKs
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 8.0.x
+ 9.0.x
+ - name: Dotnet Pack
+ shell: bash
+ run: |
+ mkdir -p packages
+ dotnet pack /p:Version=${{ steps.get_version.outputs.version }} --configuration=Release \
+ /p:PublishDir=./packages \
+ /p:NoWarn=NU5105 \
+ /p:RepositoryUrl=https://github.com/EventStore/EventStore-Client-Dotnet \
+ /p:RepositoryType=git
+ - name: Publish Artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ path: packages
+ name: nuget-packages
+ - name: Dotnet Push to Github Packages
+ shell: bash
+ if: github.event_name == 'push'
+ run: |
+ dotnet tool restore
+ find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.github_token }} --source https://nuget.pkg.github.com/EventStore/index.json --skip-duplicate
+ - name: Dotnet Push to Nuget.org
+ shell: bash
+ if: contains(steps.get_version.outputs.branch, 'v')
+ run: |
+ dotnet nuget list source
+ dotnet tool restore
+ find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.nuget_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate
diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props
index 54497a508..4e510486d 100644
--- a/samples/Directory.Build.props
+++ b/samples/Directory.Build.props
@@ -12,4 +12,4 @@
-
\ No newline at end of file
+
diff --git a/samples/Samples.sln b/samples/Samples.sln
index d3c46d188..ec2611d7b 100644
--- a/samples/Samples.sln
+++ b/samples/Samples.sln
@@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "quick-start", "quick-start\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventStore.Client", "..\src\EventStore.Client\EventStore.Client.csproj", "{A71A13F7-8480-4E48-B88D-A2364F7C95B6}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "connecting-to-a-cluster", "connecting-to-a-cluster\connecting-to-a-cluster.csproj", "{C4CA324A-450D-4621-82F1-B4ECD18216B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "appending-events", "appending-events\appending-events.csproj", "{496D9886-AF65-4579-AECE-2C147B9AF3C1}"
@@ -33,7 +31,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "diagnostics", "diagnostics\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "user-certificates", "user-certificates\user-certificates.csproj", "{28112410-D02D-427A-9D36-3FE3A6DC6B0D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventStore.Client.Extensions.OpenTelemetry", "..\src\EventStore.Client.Extensions.OpenTelemetry\EventStore.Client.Extensions.OpenTelemetry.csproj", "{29E3F07A-6676-45C1-805C-46BDF6CF325B}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kurrent.Client", "..\src\Kurrent.Client\Kurrent.Client.csproj", "{16F61817-6E46-4F52-879F-E4B92A6A90C6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -45,10 +43,6 @@ Global
{521987E5-4394-4EE0-B217-E3DC9DB0D327}.Debug|Any CPU.Build.0 = Debug|Any CPU
{521987E5-4394-4EE0-B217-E3DC9DB0D327}.Release|Any CPU.ActiveCfg = Release|Any CPU
{521987E5-4394-4EE0-B217-E3DC9DB0D327}.Release|Any CPU.Build.0 = Release|Any CPU
- {A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A71A13F7-8480-4E48-B88D-A2364F7C95B6}.Release|Any CPU.Build.0 = Release|Any CPU
{C4CA324A-450D-4621-82F1-B4ECD18216B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4CA324A-450D-4621-82F1-B4ECD18216B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4CA324A-450D-4621-82F1-B4ECD18216B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -97,17 +91,16 @@ Global
{28112410-D02D-427A-9D36-3FE3A6DC6B0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28112410-D02D-427A-9D36-3FE3A6DC6B0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28112410-D02D-427A-9D36-3FE3A6DC6B0D}.Release|Any CPU.Build.0 = Release|Any CPU
- {29E3F07A-6676-45C1-805C-46BDF6CF325B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {29E3F07A-6676-45C1-805C-46BDF6CF325B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {29E3F07A-6676-45C1-805C-46BDF6CF325B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {29E3F07A-6676-45C1-805C-46BDF6CF325B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {16F61817-6E46-4F52-879F-E4B92A6A90C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {16F61817-6E46-4F52-879F-E4B92A6A90C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {16F61817-6E46-4F52-879F-E4B92A6A90C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {16F61817-6E46-4F52-879F-E4B92A6A90C6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {A71A13F7-8480-4E48-B88D-A2364F7C95B6} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
- {29E3F07A-6676-45C1-805C-46BDF6CF325B} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
+ {16F61817-6E46-4F52-879F-E4B92A6A90C6} = {EBB93BBC-42A7-48E4-B1EA-0EA3953D347C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E7E3A6C-21DA-4DBD-9EB3-68DFC5CDE48F}
diff --git a/samples/appending-events/Program.cs b/samples/appending-events/Program.cs
index 2e1bb758f..98f12fb1a 100644
--- a/samples/appending-events/Program.cs
+++ b/samples/appending-events/Program.cs
@@ -1,10 +1,10 @@
#pragma warning disable CS8321 // Local function is declared but never used
-var settings = EventStoreClientSettings.Create("esdb://localhost:2113?tls=false");
+var settings = KurrentClientSettings.Create("esdb://localhost:2113?tls=false");
settings.OperationOptions.ThrowOnAppendFailure = false;
-await using var client = new EventStoreClient(settings);
+await using var client = new KurrentClient(settings);
await AppendToStream(client);
await AppendWithConcurrencyCheck(client);
@@ -13,7 +13,7 @@
return;
-static async Task AppendToStream(EventStoreClient client) {
+static async Task AppendToStream(KurrentClient client) {
#region append-to-stream
var eventData = new EventData(
@@ -33,7 +33,7 @@ await client.AppendToStreamAsync(
#endregion append-to-stream
}
-static async Task AppendWithSameId(EventStoreClient client) {
+static async Task AppendWithSameId(KurrentClient client) {
#region append-duplicate-event
var eventData = new EventData(
@@ -62,7 +62,7 @@ await client.AppendToStreamAsync(
#endregion append-duplicate-event
}
-static async Task AppendWithNoStream(EventStoreClient client) {
+static async Task AppendWithNoStream(KurrentClient client) {
#region append-with-no-stream
var eventDataOne = new EventData(
@@ -97,7 +97,7 @@ await client.AppendToStreamAsync(
#endregion append-with-no-stream
}
-static async Task AppendWithConcurrencyCheck(EventStoreClient client) {
+static async Task AppendWithConcurrencyCheck(KurrentClient client) {
await client.AppendToStreamAsync(
"concurrency-stream",
StreamRevision.None,
@@ -148,7 +148,7 @@ await client.AppendToStreamAsync(
#endregion append-with-concurrency-check
}
-static async Task AppendOverridingUserCredentials(EventStoreClient client, CancellationToken cancellationToken) {
+static async Task AppendOverridingUserCredentials(KurrentClient client, CancellationToken cancellationToken) {
var eventData = new EventData(
Uuid.NewUuid(),
"TestEvent",
diff --git a/samples/appending-events/appending-events.csproj b/samples/appending-events/appending-events.csproj
index 3dbe997bc..c74c70ae9 100644
--- a/samples/appending-events/appending-events.csproj
+++ b/samples/appending-events/appending-events.csproj
@@ -3,8 +3,7 @@
Exe
appending_events
-
-
+
diff --git a/samples/connecting-to-a-cluster/Program.cs b/samples/connecting-to-a-cluster/Program.cs
index a31666fc6..01b033c6c 100644
--- a/samples/connecting-to-a-cluster/Program.cs
+++ b/samples/connecting-to-a-cluster/Program.cs
@@ -1,10 +1,12 @@
-#pragma warning disable CS8321 // Local function is declared but never used
+using EventStore.Client;
+
+#pragma warning disable CS8321 // Local function is declared but never used
static void ConnectingToACluster() {
#region connecting-to-a-cluster
- using var client = new EventStoreClient(
- EventStoreClientSettings.Create("esdb://localhost:1114,localhost:2114,localhost:3114")
+ using var client = new KurrentClient(
+ KurrentClientSettings.Create("esdb://localhost:1114,localhost:2114,localhost:3114")
);
#endregion connecting-to-a-cluster
@@ -13,8 +15,8 @@ static void ConnectingToACluster() {
static void ProvidingDefaultCredentials() {
#region providing-default-credentials
- using var client = new EventStoreClient(
- EventStoreClientSettings.Create("esdb://admin:changeit@localhost:1114,localhost:2114,localhost:3114")
+ using var client = new KurrentClient(
+ KurrentClientSettings.Create("esdb://admin:changeit@localhost:1114,localhost:2114,localhost:3114")
);
#endregion providing-default-credentials
@@ -23,11 +25,11 @@ static void ProvidingDefaultCredentials() {
static void ConnectingToAClusterComplex() {
#region connecting-to-a-cluster-complex
- using var client = new EventStoreClient(
- EventStoreClientSettings.Create(
+ using var client = new KurrentClient(
+ KurrentClientSettings.Create(
"esdb://admin:changeit@localhost:1114,localhost:2114,localhost:3114?DiscoveryInterval=30000;GossipTimeout=10000;NodePreference=leader;MaxDiscoverAttempts=5"
)
);
#endregion connecting-to-a-cluster-complex
-}
\ No newline at end of file
+}
diff --git a/samples/connecting-to-a-cluster/connecting-to-a-cluster.csproj b/samples/connecting-to-a-cluster/connecting-to-a-cluster.csproj
index af05183b9..f7304d3f3 100644
--- a/samples/connecting-to-a-cluster/connecting-to-a-cluster.csproj
+++ b/samples/connecting-to-a-cluster/connecting-to-a-cluster.csproj
@@ -3,8 +3,7 @@
Exe
connecting_to_a_cluster
-
-
+
diff --git a/samples/connecting-to-a-single-node/Program.cs b/samples/connecting-to-a-single-node/Program.cs
index f50e1689f..63d0b3e98 100644
--- a/samples/connecting-to-a-single-node/Program.cs
+++ b/samples/connecting-to-a-single-node/Program.cs
@@ -1,11 +1,12 @@
using connecting_to_a_single_node;
+using EventStore.Client;
#pragma warning disable CS8321 // Local function is declared but never used
static void SimpleConnection() {
#region creating-simple-connection
- using var client = new EventStoreClient(EventStoreClientSettings.Create("esdb://localhost:2113"));
+ using var client = new KurrentClient(KurrentClientSettings.Create("esdb://localhost:2113"));
#endregion creating-simple-connection
}
@@ -13,7 +14,7 @@ static void SimpleConnection() {
static void ProvidingDefaultCredentials() {
#region providing-default-credentials
- using var client = new EventStoreClient(EventStoreClientSettings.Create("esdb://admin:changeit@localhost:2113"));
+ using var client = new KurrentClient(KurrentClientSettings.Create("esdb://admin:changeit@localhost:2113"));
#endregion providing-default-credentials
}
@@ -21,8 +22,8 @@ static void ProvidingDefaultCredentials() {
static void SpecifyingAConnectionName() {
#region setting-the-connection-name
- using var client = new EventStoreClient(
- EventStoreClientSettings.Create("esdb://admin:changeit@localhost:2113?ConnectionName=SomeConnection")
+ using var client = new KurrentClient(
+ KurrentClientSettings.Create("esdb://admin:changeit@localhost:2113?ConnectionName=SomeConnection")
);
#endregion setting-the-connection-name
@@ -31,8 +32,8 @@ static void SpecifyingAConnectionName() {
static void OverridingTheTimeout() {
#region overriding-timeout
- using var client = new EventStoreClient(
- EventStoreClientSettings.Create($"esdb://admin:changeit@localhost:2113?OperationTimeout=30000")
+ using var client = new KurrentClient(
+ KurrentClientSettings.Create($"esdb://admin:changeit@localhost:2113?OperationTimeout=30000")
);
#endregion overriding-timeout
@@ -41,8 +42,8 @@ static void OverridingTheTimeout() {
static void CombiningSettings() {
#region overriding-timeout
- using var client = new EventStoreClient(
- EventStoreClientSettings.Create(
+ using var client = new KurrentClient(
+ KurrentClientSettings.Create(
$"esdb://admin:changeit@localhost:2113?ConnectionName=SomeConnection&OperationTimeout=30000"
)
);
@@ -53,7 +54,7 @@ static void CombiningSettings() {
static void CreatingAnInterceptor() {
#region adding-an-interceptor
- var settings = new EventStoreClientSettings {
+ var settings = new KurrentClientSettings {
Interceptors = new[] { new DemoInterceptor() },
ConnectivitySettings = {
Address = new Uri("https://localhost:2113")
@@ -62,13 +63,13 @@ static void CreatingAnInterceptor() {
#endregion adding-an-interceptor
- var client = new EventStoreClient(settings);
+ var client = new KurrentClient(settings);
}
static void CustomHttpMessageHandler() {
#region adding-an-custom-http-message-handler
- var settings = new EventStoreClientSettings {
+ var settings = new KurrentClientSettings {
CreateHttpMessageHandler = () =>
new HttpClientHandler {
ServerCertificateCustomValidationCallback =
@@ -81,5 +82,5 @@ static void CustomHttpMessageHandler() {
#endregion adding-an-custom-http-message-handler
- var client = new EventStoreClient(settings);
-}
\ No newline at end of file
+ var client = new KurrentClient(settings);
+}
diff --git a/samples/connecting-to-a-single-node/connecting-to-a-single-node.csproj b/samples/connecting-to-a-single-node/connecting-to-a-single-node.csproj
index 7700f4667..97609c80a 100644
--- a/samples/connecting-to-a-single-node/connecting-to-a-single-node.csproj
+++ b/samples/connecting-to-a-single-node/connecting-to-a-single-node.csproj
@@ -2,8 +2,7 @@
Exe
-
-
+
diff --git a/samples/diagnostics/Program.cs b/samples/diagnostics/Program.cs
index 5804be7a4..86f9a6e3a 100644
--- a/samples/diagnostics/Program.cs
+++ b/samples/diagnostics/Program.cs
@@ -1,4 +1,5 @@
using System.Diagnostics;
+using EventStore.Client;
using EventStore.Client.Extensions.OpenTelemetry;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -23,17 +24,17 @@ dotnet add package OpenTelemetry.Extensions.Hosting
# endregion import-required-packages
**/
-var settings = EventStoreClientSettings.Create("esdb://localhost:2113?tls=false");
+var settings = KurrentClientSettings.Create("esdb://localhost:2113?tls=false");
settings.OperationOptions.ThrowOnAppendFailure = false;
-await using var client = new EventStoreClient(settings);
+await using var client = new KurrentClient(settings);
await TraceAppendToStream(client);
return;
-static async Task TraceAppendToStream(EventStoreClient client) {
+static async Task TraceAppendToStream(KurrentClient client) {
const string serviceName = "sample";
var host = Host.CreateDefaultBuilder()
@@ -76,7 +77,7 @@ static void ConfigureTracerProviderBuilder(TracerProviderBuilder tracerProviderB
#region register-instrumentation
tracerProviderBuilder
- .AddEventStoreClientInstrumentation();
+ .AddKurrentClientInstrumentation();
#endregion register-instrumentation
diff --git a/samples/diagnostics/diagnostics.csproj b/samples/diagnostics/diagnostics.csproj
index d0ca46e87..56bd7c49c 100644
--- a/samples/diagnostics/diagnostics.csproj
+++ b/samples/diagnostics/diagnostics.csproj
@@ -13,9 +13,6 @@
-
-
-
-
+
diff --git a/samples/persistent-subscriptions/Program.cs b/samples/persistent-subscriptions/Program.cs
index e1e9387c6..6d07b7947 100644
--- a/samples/persistent-subscriptions/Program.cs
+++ b/samples/persistent-subscriptions/Program.cs
@@ -1,5 +1,5 @@
-await using var client = new EventStorePersistentSubscriptionsClient(
- EventStoreClientSettings.Create("esdb://localhost:2113?tls=false&tlsVerifyCert=false")
+await using var client = new KurrentPersistentSubscriptionsClient(
+ KurrentClientSettings.Create("esdb://localhost:2113?tls=false&tlsVerifyCert=false")
);
await DeletePersistentSubscription(client);
@@ -36,7 +36,7 @@
return;
-static async Task CreatePersistentSubscription(EventStorePersistentSubscriptionsClient client) {
+static async Task CreatePersistentSubscription(KurrentPersistentSubscriptionsClient client) {
#region create-persistent-subscription-to-stream
var userCredentials = new UserCredentials("admin", "changeit");
@@ -54,7 +54,7 @@ await client.CreateToStreamAsync(
#endregion create-persistent-subscription-to-stream
}
-static async Task ConnectToPersistentSubscriptionToStream(EventStorePersistentSubscriptionsClient client,
+static async Task ConnectToPersistentSubscriptionToStream(KurrentPersistentSubscriptionsClient client,
CancellationToken ct) {
#region subscribe-to-persistent-subscription-to-stream
@@ -77,7 +77,7 @@ static async Task ConnectToPersistentSubscriptionToStream(EventStorePersistentSu
#endregion subscribe-to-persistent-subscription-to-stream
}
-static async Task CreatePersistentSubscriptionToAll(EventStorePersistentSubscriptionsClient client) {
+static async Task CreatePersistentSubscriptionToAll(KurrentPersistentSubscriptionsClient client) {
#region create-persistent-subscription-to-all
var userCredentials = new UserCredentials("admin", "changeit");
@@ -96,7 +96,7 @@ await client.CreateToAllAsync(
#endregion create-persistent-subscription-to-all
}
-static async Task ConnectToPersistentSubscriptionToAll(EventStorePersistentSubscriptionsClient client,
+static async Task ConnectToPersistentSubscriptionToAll(KurrentPersistentSubscriptionsClient client,
CancellationToken ct) {
#region subscribe-to-persistent-subscription-to-all
@@ -118,7 +118,7 @@ static async Task ConnectToPersistentSubscriptionToAll(EventStorePersistentSubsc
#endregion subscribe-to-persistent-subscription-to-all
}
-static async Task ConnectToPersistentSubscriptionWithManualAcks(EventStorePersistentSubscriptionsClient client,
+static async Task ConnectToPersistentSubscriptionWithManualAcks(KurrentPersistentSubscriptionsClient client,
CancellationToken ct) {
#region subscribe-to-persistent-subscription-with-manual-acks
@@ -145,7 +145,7 @@ static async Task ConnectToPersistentSubscriptionWithManualAcks(EventStorePersis
#endregion subscribe-to-persistent-subscription-with-manual-acks
}
-static async Task UpdatePersistentSubscription(EventStorePersistentSubscriptionsClient client) {
+static async Task UpdatePersistentSubscription(KurrentPersistentSubscriptionsClient client) {
#region update-persistent-subscription
var userCredentials = new UserCredentials("admin", "changeit");
@@ -163,7 +163,7 @@ await client.UpdateToStreamAsync(
#endregion update-persistent-subscription
}
-static async Task DeletePersistentSubscription(EventStorePersistentSubscriptionsClient client) {
+static async Task DeletePersistentSubscription(KurrentPersistentSubscriptionsClient client) {
#region delete-persistent-subscription
try {
@@ -184,7 +184,7 @@ await client.DeleteToStreamAsync(
#endregion delete-persistent-subscription
}
-static async Task DeletePersistentSubscriptionToAll(EventStorePersistentSubscriptionsClient client) {
+static async Task DeletePersistentSubscriptionToAll(KurrentPersistentSubscriptionsClient client) {
#region delete-persistent-subscription-to-all
try {
@@ -204,7 +204,7 @@ await client.DeleteToAllAsync(
#endregion delete-persistent-subscription-to-all
}
-static async Task GetPersistentSubscriptionToStreamInfo(EventStorePersistentSubscriptionsClient client) {
+static async Task GetPersistentSubscriptionToStreamInfo(KurrentPersistentSubscriptionsClient client) {
#region get-persistent-subscription-to-stream-info
var userCredentials = new UserCredentials("admin", "changeit");
@@ -219,7 +219,7 @@ static async Task GetPersistentSubscriptionToStreamInfo(EventStorePersistentSubs
#endregion get-persistent-subscription-to-stream-info
}
-static async Task GetPersistentSubscriptionToAllInfo(EventStorePersistentSubscriptionsClient client) {
+static async Task GetPersistentSubscriptionToAllInfo(KurrentPersistentSubscriptionsClient client) {
#region get-persistent-subscription-to-all-info
var userCredentials = new UserCredentials("admin", "changeit");
@@ -233,7 +233,7 @@ static async Task GetPersistentSubscriptionToAllInfo(EventStorePersistentSubscri
#endregion get-persistent-subscription-to-all-info
}
-static async Task ReplayParkedToStream(EventStorePersistentSubscriptionsClient client) {
+static async Task ReplayParkedToStream(KurrentPersistentSubscriptionsClient client) {
#region replay-parked-of-persistent-subscription-to-stream
var userCredentials = new UserCredentials("admin", "changeit");
@@ -249,7 +249,7 @@ await client.ReplayParkedMessagesToStreamAsync(
#endregion persistent-subscription-replay-parked-to-stream
}
-static async Task ReplayParkedToAll(EventStorePersistentSubscriptionsClient client) {
+static async Task ReplayParkedToAll(KurrentPersistentSubscriptionsClient client) {
#region replay-parked-of-persistent-subscription-to-all
var userCredentials = new UserCredentials("admin", "changeit");
@@ -264,7 +264,7 @@ await client.ReplayParkedMessagesToAllAsync(
#endregion replay-parked-of-persistent-subscription-to-all
}
-static async Task ListPersistentSubscriptionsToStream(EventStorePersistentSubscriptionsClient client) {
+static async Task ListPersistentSubscriptionsToStream(KurrentPersistentSubscriptionsClient client) {
#region list-persistent-subscriptions-to-stream
var userCredentials = new UserCredentials("admin", "changeit");
@@ -281,7 +281,7 @@ static async Task ListPersistentSubscriptionsToStream(EventStorePersistentSubscr
#endregion list-persistent-subscriptions-to-stream
}
-static async Task ListPersistentSubscriptionsToAll(EventStorePersistentSubscriptionsClient client) {
+static async Task ListPersistentSubscriptionsToAll(KurrentPersistentSubscriptionsClient client) {
#region list-persistent-subscriptions-to-all
var userCredentials = new UserCredentials("admin", "changeit");
@@ -295,7 +295,7 @@ static async Task ListPersistentSubscriptionsToAll(EventStorePersistentSubscript
#endregion list-persistent-subscriptions-to-all
}
-static async Task ListAllPersistentSubscriptions(EventStorePersistentSubscriptionsClient client) {
+static async Task ListAllPersistentSubscriptions(KurrentPersistentSubscriptionsClient client) {
#region list-persistent-subscriptions
var userCredentials = new UserCredentials("admin", "changeit");
@@ -309,7 +309,7 @@ static async Task ListAllPersistentSubscriptions(EventStorePersistentSubscriptio
#endregion list-persistent-subscriptions
}
-static async Task RestartPersistentSubscriptionSubsystem(EventStorePersistentSubscriptionsClient client) {
+static async Task RestartPersistentSubscriptionSubsystem(KurrentPersistentSubscriptionsClient client) {
#region restart-persistent-subscription-subsystem
var userCredentials = new UserCredentials("admin", "changeit");
diff --git a/samples/persistent-subscriptions/persistent-subscriptions.csproj b/samples/persistent-subscriptions/persistent-subscriptions.csproj
index 4204ed387..e296fca91 100644
--- a/samples/persistent-subscriptions/persistent-subscriptions.csproj
+++ b/samples/persistent-subscriptions/persistent-subscriptions.csproj
@@ -3,8 +3,7 @@
Exe
persistent_subscriptions
-
-
+
diff --git a/samples/projection-management/Program.cs b/samples/projection-management/Program.cs
index 0f3d66b70..478b88b10 100644
--- a/samples/projection-management/Program.cs
+++ b/samples/projection-management/Program.cs
@@ -64,20 +64,20 @@
return;
-static EventStoreProjectionManagementClient ManagementClient(string connection) {
+static KurrentProjectionManagementClient ManagementClient(string connection) {
#region createClient
- var settings = EventStoreClientSettings.Create(connection);
+ var settings = KurrentClientSettings.Create(connection);
settings.ConnectionName = "Projection management client";
settings.DefaultCredentials = new UserCredentials("admin", "changeit");
- var managementClient = new EventStoreProjectionManagementClient(settings);
+ var managementClient = new KurrentProjectionManagementClient(settings);
#endregion createClient
return managementClient;
}
-static async Task RestartSubSystem(EventStoreProjectionManagementClient managementClient) {
+static async Task RestartSubSystem(KurrentProjectionManagementClient managementClient) {
#region RestartSubSystem
await managementClient.RestartSubsystemAsync();
@@ -85,7 +85,7 @@ static async Task RestartSubSystem(EventStoreProjectionManagementClient manageme
#endregion RestartSubSystem
}
-static async Task Disable(EventStoreProjectionManagementClient managementClient) {
+static async Task Disable(KurrentProjectionManagementClient managementClient) {
#region Disable
await managementClient.DisableAsync("$by_category");
@@ -93,7 +93,7 @@ static async Task Disable(EventStoreProjectionManagementClient managementClient)
#endregion Disable
}
-static async Task DisableNotFound(EventStoreProjectionManagementClient managementClient) {
+static async Task DisableNotFound(KurrentProjectionManagementClient managementClient) {
#region DisableNotFound
try {
@@ -109,7 +109,7 @@ static async Task DisableNotFound(EventStoreProjectionManagementClient managemen
#endregion DisableNotFound
}
-static async Task Enable(EventStoreProjectionManagementClient managementClient) {
+static async Task Enable(KurrentProjectionManagementClient managementClient) {
#region Enable
await managementClient.EnableAsync("$by_category");
@@ -117,7 +117,7 @@ static async Task Enable(EventStoreProjectionManagementClient managementClient)
#endregion Enable
}
-static async Task EnableNotFound(EventStoreProjectionManagementClient managementClient) {
+static async Task EnableNotFound(KurrentProjectionManagementClient managementClient) {
#region EnableNotFound
try {
@@ -133,7 +133,7 @@ static async Task EnableNotFound(EventStoreProjectionManagementClient management
#endregion EnableNotFound
}
-static Task Delete(EventStoreProjectionManagementClient managementClient) {
+static Task Delete(KurrentProjectionManagementClient managementClient) {
#region Delete
// this is not yet available in the .net grpc client
@@ -143,7 +143,7 @@ static Task Delete(EventStoreProjectionManagementClient managementClient) {
return Task.CompletedTask;
}
-static async Task Abort(EventStoreProjectionManagementClient managementClient) {
+static async Task Abort(KurrentProjectionManagementClient managementClient) {
try {
var js =
"fromAll() .when({$init:function(){return {count:0};},$any:function(s, e){s.count += 1;}}).outputState();";
@@ -165,7 +165,7 @@ static async Task Abort(EventStoreProjectionManagementClient managementClient) {
#endregion Abort
}
-static async Task Abort_NotFound(EventStoreProjectionManagementClient managementClient) {
+static async Task Abort_NotFound(KurrentProjectionManagementClient managementClient) {
#region Abort_NotFound
try {
@@ -181,7 +181,7 @@ static async Task Abort_NotFound(EventStoreProjectionManagementClient management
#endregion Abort_NotFound
}
-static async Task Reset(EventStoreProjectionManagementClient managementClient) {
+static async Task Reset(KurrentProjectionManagementClient managementClient) {
try {
var js =
"fromAll() .when({$init:function(){return {count:0};},$any:function(s, e){s.count += 1;}}).outputState();";
@@ -203,7 +203,7 @@ static async Task Reset(EventStoreProjectionManagementClient managementClient) {
#endregion Reset
}
-static async Task Reset_NotFound(EventStoreProjectionManagementClient managementClient) {
+static async Task Reset_NotFound(KurrentProjectionManagementClient managementClient) {
#region Reset_NotFound
try {
@@ -219,14 +219,14 @@ static async Task Reset_NotFound(EventStoreProjectionManagementClient management
#endregion Reset_NotFound
}
-static async Task CreateOneTime(EventStoreProjectionManagementClient managementClient) {
+static async Task CreateOneTime(KurrentProjectionManagementClient managementClient) {
const string js =
"fromAll() .when({$init:function(){return {count:0};},$any:function(s, e){s.count += 1;}}).outputState();";
await managementClient.CreateOneTimeAsync(js);
}
-static async Task CreateContinuous(EventStoreProjectionManagementClient managementClient) {
+static async Task CreateContinuous(KurrentProjectionManagementClient managementClient) {
#region CreateContinuous
const string js = @"fromAll()
@@ -248,7 +248,7 @@ static async Task CreateContinuous(EventStoreProjectionManagementClient manageme
#endregion CreateContinuous
}
-static async Task CreateContinuous_Conflict(EventStoreProjectionManagementClient managementClient) {
+static async Task CreateContinuous_Conflict(KurrentProjectionManagementClient managementClient) {
const string js = @"fromAll()
.when({
$init: function() {
@@ -281,7 +281,7 @@ static async Task CreateContinuous_Conflict(EventStoreProjectionManagementClient
#endregion CreateContinuous_Conflict
}
-static async Task Update(EventStoreProjectionManagementClient managementClient) {
+static async Task Update(KurrentProjectionManagementClient managementClient) {
#region Update
const string js = @"fromAll()
@@ -305,7 +305,7 @@ static async Task Update(EventStoreProjectionManagementClient managementClient)
#endregion Update
}
-static async Task Update_NotFound(EventStoreProjectionManagementClient managementClient) {
+static async Task Update_NotFound(KurrentProjectionManagementClient managementClient) {
#region Update_NotFound
try {
@@ -321,7 +321,7 @@ static async Task Update_NotFound(EventStoreProjectionManagementClient managemen
#endregion Update_NotFound
}
-static async Task ListAll(EventStoreProjectionManagementClient managementClient) {
+static async Task ListAll(KurrentProjectionManagementClient managementClient) {
#region ListAll
var details = managementClient.ListAllAsync();
@@ -333,7 +333,7 @@ static async Task ListAll(EventStoreProjectionManagementClient managementClient)
#endregion ListAll
}
-static async Task ListContinuous(EventStoreProjectionManagementClient managementClient) {
+static async Task ListContinuous(KurrentProjectionManagementClient managementClient) {
#region ListContinuous
var details = managementClient.ListContinuousAsync();
@@ -345,7 +345,7 @@ static async Task ListContinuous(EventStoreProjectionManagementClient management
#endregion ListContinuous
}
-static async Task GetStatus(EventStoreProjectionManagementClient managementClient) {
+static async Task GetStatus(KurrentProjectionManagementClient managementClient) {
const string js =
"fromAll().when({$init:function(){return {count:0};},$any:function(s, e){s.count += 1;}}).outputState();";
@@ -362,7 +362,7 @@ static async Task GetStatus(EventStoreProjectionManagementClient managementClien
#endregion GetStatus
}
-static async Task GetState(EventStoreProjectionManagementClient managementClient) {
+static async Task GetState(KurrentProjectionManagementClient managementClient) {
// will have to wait for the client to be fixed before we import in the doc
#region GetState
@@ -393,7 +393,7 @@ static async Task DocToString(JsonDocument d) {
#endregion GetState
}
-static async Task GetResult(EventStoreProjectionManagementClient managementClient) {
+static async Task GetResult(KurrentProjectionManagementClient managementClient) {
#region GetResult
const string js = @"fromAll()
@@ -433,9 +433,9 @@ static string DocToString(JsonDocument d) {
}
static async Task Populate(string connection, int numberOfEvents) {
- var settings = EventStoreClientSettings.Create(connection);
+ var settings = KurrentClientSettings.Create(connection);
settings.DefaultCredentials = new UserCredentials("admin", "changeit");
- var client = new EventStoreClient(settings);
+ var client = new KurrentClient(settings);
var messages = Enumerable.Range(0, numberOfEvents).Select(
number =>
new EventData(
@@ -452,4 +452,4 @@ public class Result {
public int count { get; set; }
public override string ToString() => $"count= {count}";
-};
\ No newline at end of file
+};
diff --git a/samples/projection-management/projection-management.csproj b/samples/projection-management/projection-management.csproj
index 80fe56f78..f6a6206aa 100644
--- a/samples/projection-management/projection-management.csproj
+++ b/samples/projection-management/projection-management.csproj
@@ -2,8 +2,7 @@
projection_management
-
-
+
diff --git a/samples/quick-start/Program.cs b/samples/quick-start/Program.cs
index 0cd070137..dd763ae42 100644
--- a/samples/quick-start/Program.cs
+++ b/samples/quick-start/Program.cs
@@ -7,9 +7,9 @@
const string connectionString = "esdb://admin:changeit@localhost:2113?tls=false&tlsVerifyCert=false";
-var settings = EventStoreClientSettings.Create(connectionString);
+var settings = KurrentClientSettings.Create(connectionString);
-var client = new EventStoreClient(settings);
+var client = new KurrentClient(settings);
#endregion createClient
@@ -67,4 +67,4 @@ await client.AppendToStreamAsync(
public class TestEvent {
public string? EntityId { get; set; }
public string? ImportantData { get; set; }
-}
\ No newline at end of file
+}
diff --git a/samples/quick-start/quick-start.csproj b/samples/quick-start/quick-start.csproj
index 74eea2001..5fe35463c 100644
--- a/samples/quick-start/quick-start.csproj
+++ b/samples/quick-start/quick-start.csproj
@@ -2,8 +2,7 @@
quick_start
-
-
+
diff --git a/samples/reading-events/Program.cs b/samples/reading-events/Program.cs
index 854634da8..751086d5c 100644
--- a/samples/reading-events/Program.cs
+++ b/samples/reading-events/Program.cs
@@ -1,6 +1,6 @@
#pragma warning disable CS8321 // Local function is declared but never used
-await using var client = new EventStoreClient(EventStoreClientSettings.Create("esdb://localhost:2113?tls=false"));
+await using var client = new KurrentClient(KurrentClientSettings.Create("esdb://localhost:2113?tls=false"));
var events = Enumerable.Range(0, 20)
.Select(
@@ -21,7 +21,7 @@ await client.AppendToStreamAsync(
return;
-static async Task ReadFromStream(EventStoreClient client) {
+static async Task ReadFromStream(KurrentClient client) {
#region read-from-stream
var events = client.ReadStreamAsync(
@@ -46,7 +46,7 @@ static async Task ReadFromStream(EventStoreClient client) {
#endregion
}
-static async Task ReadFromStreamMessages(EventStoreClient client) {
+static async Task ReadFromStreamMessages(KurrentClient client) {
#region read-from-stream-messages
var streamPosition = StreamPosition.Start;
@@ -90,7 +90,7 @@ static async Task ReadFromStreamMessages(EventStoreClient client) {
#endregion iterate-stream-messages
}
-static async Task ReadFromStreamPosition(EventStoreClient client) {
+static async Task ReadFromStreamPosition(KurrentClient client) {
#region read-from-stream-position
var events = client.ReadStreamAsync(
@@ -109,7 +109,7 @@ static async Task ReadFromStreamPosition(EventStoreClient client) {
#endregion iterate-stream
}
-static async Task ReadFromStreamPositionCheck(EventStoreClient client) {
+static async Task ReadFromStreamPositionCheck(KurrentClient client) {
#region checking-for-stream-presence
var result = client.ReadStreamAsync(
@@ -126,7 +126,7 @@ static async Task ReadFromStreamPositionCheck(EventStoreClient client) {
#endregion checking-for-stream-presence
}
-static async Task ReadFromStreamBackwards(EventStoreClient client) {
+static async Task ReadFromStreamBackwards(KurrentClient client) {
#region reading-backwards
var events = client.ReadStreamAsync(
@@ -140,7 +140,7 @@ static async Task ReadFromStreamBackwards(EventStoreClient client) {
#endregion reading-backwards
}
-static async Task ReadFromStreamMessagesBackwards(EventStoreClient client) {
+static async Task ReadFromStreamMessagesBackwards(KurrentClient client) {
#region read-from-stream-messages-backwards
var results = client.ReadStreamAsync(
@@ -175,7 +175,7 @@ static async Task ReadFromStreamMessagesBackwards(EventStoreClient client) {
#endregion iterate-stream-messages-backwards
}
-static async Task ReadFromAllStream(EventStoreClient client) {
+static async Task ReadFromAllStream(KurrentClient client) {
#region read-from-all-stream
var events = client.ReadAllAsync(Direction.Forwards, Position.Start);
@@ -189,7 +189,7 @@ static async Task ReadFromAllStream(EventStoreClient client) {
#endregion read-from-all-stream-iterate
}
-static async Task ReadFromAllStreamMessages(EventStoreClient client) {
+static async Task ReadFromAllStreamMessages(KurrentClient client) {
#region read-from-all-stream-messages
var position = Position.Start;
@@ -216,7 +216,7 @@ static async Task ReadFromAllStreamMessages(EventStoreClient client) {
#endregion iterate-all-stream-messages
}
-static async Task IgnoreSystemEvents(EventStoreClient client) {
+static async Task IgnoreSystemEvents(KurrentClient client) {
#region ignore-system-events
var events = client.ReadAllAsync(Direction.Forwards, Position.Start);
@@ -230,7 +230,7 @@ static async Task IgnoreSystemEvents(EventStoreClient client) {
#endregion ignore-system-events
}
-static async Task ReadFromAllStreamBackwards(EventStoreClient client) {
+static async Task ReadFromAllStreamBackwards(KurrentClient client) {
#region read-from-all-stream-backwards
var events = client.ReadAllAsync(Direction.Backwards, Position.End);
@@ -244,7 +244,7 @@ static async Task ReadFromAllStreamBackwards(EventStoreClient client) {
#endregion read-from-all-stream-iterate
}
-static async Task ReadFromAllStreamBackwardsMessages(EventStoreClient client) {
+static async Task ReadFromAllStreamBackwardsMessages(KurrentClient client) {
#region read-from-all-stream-messages-backwards
var position = Position.End;
@@ -272,7 +272,7 @@ static async Task ReadFromAllStreamBackwardsMessages(EventStoreClient client) {
#endregion iterate-all-stream-messages-backwards
}
-static async Task FilteringOutSystemEvents(EventStoreClient client) {
+static async Task FilteringOutSystemEvents(KurrentClient client) {
var events = client.ReadAllAsync(Direction.Forwards, Position.Start);
await foreach (var e in events)
@@ -280,7 +280,7 @@ static async Task FilteringOutSystemEvents(EventStoreClient client) {
Console.WriteLine(Encoding.UTF8.GetString(e.Event.Data.ToArray()));
}
-static void ReadStreamOverridingUserCredentials(EventStoreClient client, CancellationToken cancellationToken) {
+static void ReadStreamOverridingUserCredentials(KurrentClient client, CancellationToken cancellationToken) {
#region overriding-user-credentials
var result = client.ReadStreamAsync(
@@ -294,7 +294,7 @@ static void ReadStreamOverridingUserCredentials(EventStoreClient client, Cancell
#endregion overriding-user-credentials
}
-static void ReadAllOverridingUserCredentials(EventStoreClient client, CancellationToken cancellationToken) {
+static void ReadAllOverridingUserCredentials(KurrentClient client, CancellationToken cancellationToken) {
#region read-all-overriding-user-credentials
var result = client.ReadAllAsync(
@@ -307,7 +307,7 @@ static void ReadAllOverridingUserCredentials(EventStoreClient client, Cancellati
#endregion read-all-overriding-user-credentials
}
-static void ReadAllResolvingLinkTos(EventStoreClient client, CancellationToken cancellationToken) {
+static void ReadAllResolvingLinkTos(KurrentClient client, CancellationToken cancellationToken) {
#region read-from-all-stream-resolving-link-Tos
var result = client.ReadAllAsync(
@@ -318,4 +318,4 @@ static void ReadAllResolvingLinkTos(EventStoreClient client, CancellationToken c
);
#endregion read-from-all-stream-resolving-link-Tos
-}
\ No newline at end of file
+}
diff --git a/samples/reading-events/reading-events.csproj b/samples/reading-events/reading-events.csproj
index d29b531fb..d79ede9fc 100644
--- a/samples/reading-events/reading-events.csproj
+++ b/samples/reading-events/reading-events.csproj
@@ -2,8 +2,7 @@
reading_events
-
-
+
diff --git a/samples/secure-with-tls/Program.cs b/samples/secure-with-tls/Program.cs
index 621ee46b1..b2dcd05bb 100644
--- a/samples/secure-with-tls/Program.cs
+++ b/samples/secure-with-tls/Program.cs
@@ -6,7 +6,7 @@
Console.WriteLine($"Connecting to EventStoreDB at: {connectionString}");
-await using var client = new EventStoreClient(EventStoreClientSettings.Create(connectionString));
+await using var client = new KurrentClient(KurrentClientSettings.Create(connectionString));
var eventData = new EventData(Uuid.NewUuid(), "some-event", "{\"id\": \"1\" \"value\": \"some value\"}"u8.ToArray());
@@ -48,4 +48,4 @@
}
Console.WriteLine($"FAILED! {exception}");
-}
\ No newline at end of file
+}
diff --git a/samples/secure-with-tls/secure-with-tls.csproj b/samples/secure-with-tls/secure-with-tls.csproj
index 9d29b3972..a11ffdb55 100644
--- a/samples/secure-with-tls/secure-with-tls.csproj
+++ b/samples/secure-with-tls/secure-with-tls.csproj
@@ -14,6 +14,6 @@
-
+
diff --git a/samples/server-side-filtering/Program.cs b/samples/server-side-filtering/Program.cs
index b9e5de8c8..b8641905a 100644
--- a/samples/server-side-filtering/Program.cs
+++ b/samples/server-side-filtering/Program.cs
@@ -6,7 +6,7 @@
var semaphore = new SemaphoreSlim(eventCount);
-await using var client = new EventStoreClient(EventStoreClientSettings.Create("esdb://localhost:2113?tls=false"));
+await using var client = new KurrentClient(KurrentClientSettings.Create("esdb://localhost:2113?tls=false"));
_ = Task.Run(async () => {
await using var subscription = client.SubscribeToAll(
@@ -46,7 +46,7 @@ await client.AppendToStreamAsync(
return;
-static async Task ExcludeSystemEvents(EventStoreClient client) {
+static async Task ExcludeSystemEvents(KurrentClient client) {
#region exclude-system
await using var subscription = client.SubscribeToAll(
@@ -63,7 +63,7 @@ static async Task ExcludeSystemEvents(EventStoreClient client) {
#endregion exclude-system
}
-static async Task EventTypePrefix(EventStoreClient client) {
+static async Task EventTypePrefix(KurrentClient client) {
#region event-type-prefix
var filterOptions = new SubscriptionFilterOptions(EventTypeFilter.Prefix("customer-"));
@@ -80,7 +80,7 @@ static async Task EventTypePrefix(EventStoreClient client) {
}
}
-static async Task EventTypeRegex(EventStoreClient client) {
+static async Task EventTypeRegex(KurrentClient client) {
#region event-type-regex
var filterOptions = new SubscriptionFilterOptions(EventTypeFilter.RegularExpression("^user|^company"));
@@ -97,7 +97,7 @@ static async Task EventTypeRegex(EventStoreClient client) {
}
}
-static async Task StreamPrefix(EventStoreClient client) {
+static async Task StreamPrefix(KurrentClient client) {
#region stream-prefix
var filterOptions = new SubscriptionFilterOptions(StreamFilter.Prefix("user-"));
@@ -114,7 +114,7 @@ static async Task StreamPrefix(EventStoreClient client) {
}
}
-static async Task StreamRegex(EventStoreClient client) {
+static async Task StreamRegex(KurrentClient client) {
#region stream-regex
var filterOptions = new SubscriptionFilterOptions(StreamFilter.RegularExpression("^account|^savings"));
@@ -131,7 +131,7 @@ static async Task StreamRegex(EventStoreClient client) {
}
}
-static async Task CheckpointCallback(EventStoreClient client) {
+static async Task CheckpointCallback(KurrentClient client) {
#region checkpoint
var filterOptions = new SubscriptionFilterOptions(EventTypeFilter.ExcludeSystemEvents());
@@ -151,7 +151,7 @@ static async Task CheckpointCallback(EventStoreClient client) {
#endregion checkpoint
}
-static async Task CheckpointCallbackWithInterval(EventStoreClient client) {
+static async Task CheckpointCallbackWithInterval(KurrentClient client) {
#region checkpoint-with-interval
var filterOptions = new SubscriptionFilterOptions(EventTypeFilter.ExcludeSystemEvents(), 1000);
diff --git a/samples/server-side-filtering/server-side-filtering.csproj b/samples/server-side-filtering/server-side-filtering.csproj
index 0c13c9497..f3a5ffc58 100644
--- a/samples/server-side-filtering/server-side-filtering.csproj
+++ b/samples/server-side-filtering/server-side-filtering.csproj
@@ -2,8 +2,7 @@
server_side_filtering
-
-
+
diff --git a/samples/setting-up-dependency-injection/Controllers/EventStoreController.cs b/samples/setting-up-dependency-injection/Controllers/EventStoreController.cs
index d4c3f4d59..f66c237ce 100644
--- a/samples/setting-up-dependency-injection/Controllers/EventStoreController.cs
+++ b/samples/setting-up-dependency-injection/Controllers/EventStoreController.cs
@@ -5,15 +5,15 @@ namespace setting_up_dependency_injection.Controllers {
[Route("[controller]")]
public class EventStoreController : ControllerBase {
#region using-dependency
- private readonly EventStoreClient _eventStoreClient;
+ private readonly KurrentClient _KurrentClient;
- public EventStoreController(EventStoreClient eventStoreClient) {
- _eventStoreClient = eventStoreClient;
+ public EventStoreController(KurrentClient KurrentClient) {
+ _KurrentClient = KurrentClient;
}
[HttpGet]
public IAsyncEnumerable Get() {
- return _eventStoreClient.ReadAllAsync(Direction.Forwards, Position.Start);
+ return _KurrentClient.ReadAllAsync(Direction.Forwards, Position.Start);
}
#endregion using-dependency
}
diff --git a/samples/setting-up-dependency-injection/Startup.cs b/samples/setting-up-dependency-injection/Startup.cs
index a1d618aff..cb8c9fb94 100644
--- a/samples/setting-up-dependency-injection/Startup.cs
+++ b/samples/setting-up-dependency-injection/Startup.cs
@@ -10,7 +10,7 @@ public void ConfigureServices(IServiceCollection services) {
#region setting-up-dependency
- services.AddEventStoreClient("esdb://admin:changeit@localhost:2113?tls=false");
+ services.AddKurrentClient("esdb://admin:changeit@localhost:2113?tls=false");
#endregion setting-up-dependency
}
@@ -22,4 +22,4 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
app.UseRouting();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
}
-}
\ No newline at end of file
+}
diff --git a/samples/setting-up-dependency-injection/setting-up-dependency-injection.csproj b/samples/setting-up-dependency-injection/setting-up-dependency-injection.csproj
index 3a57950a1..e4f581a89 100644
--- a/samples/setting-up-dependency-injection/setting-up-dependency-injection.csproj
+++ b/samples/setting-up-dependency-injection/setting-up-dependency-injection.csproj
@@ -4,6 +4,6 @@
-
+
diff --git a/samples/subscribing-to-streams/Program.cs b/samples/subscribing-to-streams/Program.cs
index 90fa29737..01990a17e 100644
--- a/samples/subscribing-to-streams/Program.cs
+++ b/samples/subscribing-to-streams/Program.cs
@@ -3,7 +3,7 @@
// ReSharper disable UnusedParameter.Local
// ReSharper disable UnusedVariable
-await using var client = new EventStoreClient(EventStoreClientSettings.Create("esdb://localhost:2113?tls=false"));
+await using var client = new KurrentClient(KurrentClientSettings.Create("esdb://localhost:2113?tls=false"));
await Task.WhenAll(YieldSamples().Select(async sample => {
try {
@@ -27,7 +27,7 @@ IEnumerable YieldSamples() {
yield return OverridingUserCredentials(client, GetCT());
}
-static async Task SubscribeToStreamFromPosition(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToStreamFromPosition(KurrentClient client, CancellationToken ct) {
#region subscribe-to-stream-from-position
await using var subscription = client.SubscribeToStream(
@@ -46,7 +46,7 @@ static async Task SubscribeToStreamFromPosition(EventStoreClient client, Cancell
#endregion subscribe-to-stream-from-position
}
-static async Task SubscribeToStreamLive(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToStreamLive(KurrentClient client, CancellationToken ct) {
#region subscribe-to-stream-live
await using var subscription = client.SubscribeToStream(
@@ -65,7 +65,7 @@ static async Task SubscribeToStreamLive(EventStoreClient client, CancellationTok
#endregion subscribe-to-stream-live
}
-static async Task SubscribeToStreamResolvingLinkTos(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToStreamResolvingLinkTos(KurrentClient client, CancellationToken ct) {
#region subscribe-to-stream-resolving-linktos
await using var subscription = client.SubscribeToStream(
@@ -85,7 +85,7 @@ static async Task SubscribeToStreamResolvingLinkTos(EventStoreClient client, Can
#endregion subscribe-to-stream-resolving-linktos
}
-static async Task SubscribeToStreamSubscriptionDropped(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToStreamSubscriptionDropped(KurrentClient client, CancellationToken ct) {
#region subscribe-to-stream-subscription-dropped
var checkpoint = await ReadStreamCheckpointAsync() switch {
@@ -120,7 +120,7 @@ static async Task SubscribeToStreamSubscriptionDropped(EventStoreClient client,
#endregion subscribe-to-stream-subscription-dropped
}
-static async Task SubscribeToStream(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToStream(KurrentClient client, CancellationToken ct) {
#region subscribe-to-stream
await using var subscription = client.SubscribeToStream(
@@ -139,7 +139,7 @@ static async Task SubscribeToStream(EventStoreClient client, CancellationToken c
#endregion subscribe-to-stream
}
-static async Task SubscribeToAll(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToAll(KurrentClient client, CancellationToken ct) {
#region subscribe-to-all
await using var subscription = client.SubscribeToAll(
@@ -157,7 +157,7 @@ static async Task SubscribeToAll(EventStoreClient client, CancellationToken ct)
#endregion subscribe-to-all
}
-static async Task SubscribeToAllFromPosition(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToAllFromPosition(KurrentClient client, CancellationToken ct) {
#region subscribe-to-all-from-position
var result = await client.AppendToStreamAsync(
@@ -182,7 +182,7 @@ static async Task SubscribeToAllFromPosition(EventStoreClient client, Cancellati
#endregion subscribe-to-all-from-position
}
-static async Task SubscribeToAllLive(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToAllLive(KurrentClient client, CancellationToken ct) {
#region subscribe-to-all-live
var subscription = client.SubscribeToAll(
@@ -200,7 +200,7 @@ static async Task SubscribeToAllLive(EventStoreClient client, CancellationToken
#endregion subscribe-to-all-live
}
-static async Task SubscribeToAllSubscriptionDropped(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToAllSubscriptionDropped(KurrentClient client, CancellationToken ct) {
#region subscribe-to-all-subscription-dropped
var checkpoint = await ReadCheckpointAsync() switch {
@@ -237,7 +237,7 @@ static async Task SubscribeToAllSubscriptionDropped(EventStoreClient client, Can
#endregion subscribe-to-all-subscription-dropped
}
-static async Task SubscribeToFiltered(EventStoreClient client, CancellationToken ct) {
+static async Task SubscribeToFiltered(KurrentClient client, CancellationToken ct) {
#region stream-prefix-filtered-subscription
var prefixStreamFilter = new SubscriptionFilterOptions(StreamFilter.Prefix("test-", "other-"));
@@ -267,7 +267,7 @@ static async Task SubscribeToFiltered(EventStoreClient client, CancellationToken
#endregion stream-regex-filtered-subscription
}
-static async Task OverridingUserCredentials(EventStoreClient client, CancellationToken ct) {
+static async Task OverridingUserCredentials(KurrentClient client, CancellationToken ct) {
#region overriding-user-credentials
await using var subscription = client.SubscribeToAll(
diff --git a/samples/subscribing-to-streams/subscribing-to-streams.csproj b/samples/subscribing-to-streams/subscribing-to-streams.csproj
index 92424b533..83a740e45 100644
--- a/samples/subscribing-to-streams/subscribing-to-streams.csproj
+++ b/samples/subscribing-to-streams/subscribing-to-streams.csproj
@@ -2,8 +2,7 @@
subscribing_to_streams
-
-
+
diff --git a/samples/user-certificates/Program.cs b/samples/user-certificates/Program.cs
index dddbb1c7f..98f9e882e 100644
--- a/samples/user-certificates/Program.cs
+++ b/samples/user-certificates/Program.cs
@@ -9,11 +9,11 @@ static async Task ClientWithUserCertificates() {
const string userCertFile = "/path/to/user.crt";
const string userKeyFile = "/path/to/user.key";
- var settings = EventStoreClientSettings.Create(
+ var settings = KurrentClientSettings.Create(
$"esdb://localhost:2113/?tls=true&tlsVerifyCert=true&userCertFile={userCertFile}&userKeyFile={userKeyFile}"
);
- await using var client = new EventStoreClient(settings);
+ await using var client = new KurrentClient(settings);
# endregion client-with-user-certificates
} catch (InvalidClientCertificateException) {
diff --git a/samples/user-certificates/user-certificates.csproj b/samples/user-certificates/user-certificates.csproj
index 8cb9d2294..14de7d848 100644
--- a/samples/user-certificates/user-certificates.csproj
+++ b/samples/user-certificates/user-certificates.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/src/EventStore.Client.Extensions.OpenTelemetry/EventStore.Client.Extensions.OpenTelemetry.csproj b/src/EventStore.Client.Extensions.OpenTelemetry/EventStore.Client.Extensions.OpenTelemetry.csproj
deleted file mode 100644
index 81f4d38ea..000000000
--- a/src/EventStore.Client.Extensions.OpenTelemetry/EventStore.Client.Extensions.OpenTelemetry.csproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- EventStore.Client.Extensions.OpenTelemetry
-
-
-
- EventStore.Client.Extensions.OpenTelemetry
- Extensions used to facilitate instrumentation of the EventStore Client.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/EventStore.Client.Extensions.OpenTelemetry/TracerProviderBuilderExtensions.cs b/src/EventStore.Client.Extensions.OpenTelemetry/TracerProviderBuilderExtensions.cs
deleted file mode 100644
index 6a8b42b96..000000000
--- a/src/EventStore.Client.Extensions.OpenTelemetry/TracerProviderBuilderExtensions.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using EventStore.Client.Diagnostics;
-using JetBrains.Annotations;
-using OpenTelemetry.Trace;
-
-namespace EventStore.Client.Extensions.OpenTelemetry;
-
-///
-/// Extension methods used to facilitate tracing instrumentation of the EventStore Client.
-///
-[PublicAPI]
-public static class TracerProviderBuilderExtensions {
- ///
- /// Adds the EventStore client ActivitySource name to the list of subscribed sources on the
- ///
- /// being configured.
- /// The instance of to chain configuration.
- public static TracerProviderBuilder AddEventStoreClientInstrumentation(this TracerProviderBuilder builder) =>
- builder.AddSource(EventStoreClientDiagnostics.InstrumentationName);
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Certificates/X509Certificates.cs b/src/EventStore.Client/Core/Certificates/X509Certificates.cs
deleted file mode 100644
index 3fe1006f5..000000000
--- a/src/EventStore.Client/Core/Certificates/X509Certificates.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-
-using System.Security.Cryptography;
-using System.Security.Cryptography.X509Certificates;
-
-#if NET48
-using Org.BouncyCastle.Crypto;
-using Org.BouncyCastle.Crypto.Parameters;
-using Org.BouncyCastle.OpenSsl;
-using Org.BouncyCastle.Security;
-#endif
-
-namespace EventStore.Client;
-
-static class X509Certificates {
- // TODO SS: Use .NET 8 X509Certificate2.CreateFromPemFile(certPemFilePath, keyPemFilePath) once the Windows32Exception issue is resolved
- public static X509Certificate2 CreateFromPemFile(string certPemFilePath, string keyPemFilePath) {
- try {
-#if NET9_0_OR_GREATER
- using var publicCert = X509CertificateLoader.LoadCertificateFromFile(certPemFilePath);
-#else
- using var publicCert = new X509Certificate2(certPemFilePath);
-#endif
- using var privateKey = RSA.Create().ImportPrivateKeyFromFile(keyPemFilePath);
- using var certificate = publicCert.CopyWithPrivateKey(privateKey);
-
-#if NET48
- return new(certificate.Export(X509ContentType.Pfx));
-#else
- return X509Certificate2.CreateFromPemFile(certPemFilePath, keyPemFilePath);
-#endif
- } catch (Exception ex) {
- throw new CryptographicException($"Failed to load private key: {ex.Message}");
- }
-
- // Notes:
- // using X509Certificate2.CreateFromPemFile(certPemFilePath, keyPemFilePath) would be the ideal choice here,
- // but it's currently causing a Win32Exception specifically on Windows. Alternative implementation is used until the issue is resolved.
- //
- // Error: The SSL connection could not be established, see inner exception. AuthenticationException: Authentication failed because the platform
- // does not support ephemeral keys. Win32Exception: No credentials are available in the security package
- //
- // public static X509Certificate2 CreateFromPemFile(string certPemFilePath, string keyPemFilePath) =>
- // X509Certificate2.CreateFromPemFile(certPemFilePath, keyPemFilePath);
- }
-}
-
-public static class RsaExtensions {
-#if NET48
- public static RSA ImportPrivateKeyFromFile(this RSA rsa, string privateKeyPath) {
- var (content, label) = LoadPemKeyFile(privateKeyPath);
-
- using var reader = new PemReader(new StringReader(string.Join(Environment.NewLine, content)));
-
- var keyParameters = reader.ReadObject() switch {
- RsaPrivateCrtKeyParameters parameters => parameters,
- AsymmetricCipherKeyPair keyPair => keyPair.Private as RsaPrivateCrtKeyParameters,
- _ => throw new NotSupportedException($"Invalid private key format: {label}")
- };
-
- rsa.ImportParameters(DotNetUtilities.ToRSAParameters(keyParameters));
-
- return rsa;
- }
-#else
- public static RSA ImportPrivateKeyFromFile(this RSA rsa, string privateKeyPath) {
- var (content, label) = LoadPemKeyFile(privateKeyPath);
-
- var privateKey = string.Join(string.Empty, content[1..^1]);
- var privateKeyBytes = Convert.FromBase64String(privateKey);
-
- if (label == RsaPemLabels.Pkcs8PrivateKey)
- rsa.ImportPkcs8PrivateKey(privateKeyBytes, out _);
- else if (label == RsaPemLabels.RSAPrivateKey)
- rsa.ImportRSAPrivateKey(privateKeyBytes, out _);
-
- return rsa;
- }
-#endif
-
- static (string[] Content, string Label) LoadPemKeyFile(string privateKeyPath) {
- var content = File.ReadAllLines(privateKeyPath);
- var label = RsaPemLabels.ParseKeyLabel(content[0]);
-
- if (RsaPemLabels.IsEncryptedPrivateKey(label))
- throw new NotSupportedException("Encrypted private keys are not supported");
-
- return (content, label);
- }
-}
-
-static class RsaPemLabels {
- public const string RSAPrivateKey = "RSA PRIVATE KEY";
- public const string Pkcs8PrivateKey = "PRIVATE KEY";
- public const string EncryptedPkcs8PrivateKey = "ENCRYPTED PRIVATE KEY";
-
- public static readonly string[] PrivateKeyLabels = [RSAPrivateKey, Pkcs8PrivateKey, EncryptedPkcs8PrivateKey];
-
- public static bool IsPrivateKey(string label) => Array.IndexOf(PrivateKeyLabels, label) != -1;
-
- public static bool IsEncryptedPrivateKey(string label) => label == EncryptedPkcs8PrivateKey;
-
- const string LabelPrefix = "-----BEGIN ";
- const string LabelSuffix = "-----";
-
- public static string ParseKeyLabel(string pemFileHeader) {
- var label = pemFileHeader.Replace(LabelPrefix, string.Empty).Replace(LabelSuffix, string.Empty);
-
- if (!IsPrivateKey(label))
- throw new CryptographicException($"Unknown private key label: {label}");
-
- return label;
- }
-}
diff --git a/src/EventStore.Client/Core/ChannelBaseExtensions.cs b/src/EventStore.Client/Core/ChannelBaseExtensions.cs
deleted file mode 100644
index 3edbf59fd..000000000
--- a/src/EventStore.Client/Core/ChannelBaseExtensions.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using Grpc.Core;
-
-namespace EventStore.Client;
-
-static class ChannelBaseExtensions {
- public static async ValueTask DisposeAsync(this ChannelBase channel) {
- await channel.ShutdownAsync().ConfigureAwait(false);
- (channel as IDisposable)?.Dispose();
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/ChannelCache.cs b/src/EventStore.Client/Core/ChannelCache.cs
deleted file mode 100644
index a3369e25f..000000000
--- a/src/EventStore.Client/Core/ChannelCache.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-using System.Net;
-using TChannel = Grpc.Net.Client.GrpcChannel;
-
-namespace EventStore.Client {
- // Maintains Channels keyed by DnsEndPoint so the channels can be reused.
- // Deals with the disposal difference between grpc.net and grpc.core
- // Thread safe.
- internal class ChannelCache :
- IAsyncDisposable {
-
- private readonly EventStoreClientSettings _settings;
- private readonly Random _random;
- private readonly Dictionary _channels;
- private readonly object _lock = new();
- private bool _disposed;
-
- public ChannelCache(EventStoreClientSettings settings) {
- _settings = settings;
- _random = new Random(0);
- _channels = new Dictionary(
- DnsEndPointEqualityComparer.Instance);
- }
-
- public TChannel GetChannelInfo(DnsEndPoint endPoint) {
- lock (_lock) {
- ThrowIfDisposed();
-
- if (!_channels.TryGetValue(endPoint, out var channel)) {
- channel = ChannelFactory.CreateChannel(
- settings: _settings,
- endPoint: endPoint);
- _channels[endPoint] = channel;
- }
-
- return channel;
- }
- }
-
- public KeyValuePair[] GetRandomOrderSnapshot() {
- lock (_lock) {
- ThrowIfDisposed();
-
- return _channels
- .OrderBy(_ => _random.Next())
- .ToArray();
- }
- }
-
- // Update the cache to contain channels for exactly these endpoints
- public void UpdateCache(IEnumerable endPoints) {
- lock (_lock) {
- ThrowIfDisposed();
-
- // remove
- var endPointsToDiscard = _channels.Keys
- .Except(endPoints, DnsEndPointEqualityComparer.Instance)
- .ToArray();
-
- var channelsToDispose = new List(endPointsToDiscard.Length);
-
- foreach (var endPoint in endPointsToDiscard) {
- if (!_channels.TryGetValue(endPoint, out var channel))
- continue;
-
- _channels.Remove(endPoint);
- channelsToDispose.Add(channel);
- }
-
- _ = DisposeChannelsAsync(channelsToDispose);
-
- // add
- foreach (var endPoint in endPoints) {
- GetChannelInfo(endPoint);
- }
- }
- }
-
- public void Dispose() {
- lock (_lock) {
- if (_disposed)
- return;
-
- _disposed = true;
-
- foreach (var channel in _channels.Values) {
- channel.Dispose();
- }
-
- _channels.Clear();
- }
- }
-
- public async ValueTask DisposeAsync() {
- var channelsToDispose = Array.Empty();
-
- lock (_lock) {
- if (_disposed)
- return;
- _disposed = true;
-
- channelsToDispose = _channels.Values.ToArray();
- _channels.Clear();
- }
-
- await DisposeChannelsAsync(channelsToDispose).ConfigureAwait(false);
- }
-
- private void ThrowIfDisposed() {
- lock (_lock) {
- if (_disposed) {
- throw new ObjectDisposedException(GetType().ToString());
- }
- }
- }
-
- private static async Task DisposeChannelsAsync(IEnumerable channels) {
- foreach (var channel in channels)
- await channel.DisposeAsync().ConfigureAwait(false);
- }
-
- private class DnsEndPointEqualityComparer : IEqualityComparer {
- public static readonly DnsEndPointEqualityComparer Instance = new();
-
- public bool Equals(DnsEndPoint? x, DnsEndPoint? y) {
- if (ReferenceEquals(x, y))
- return true;
- if (x is null)
- return false;
- if (y is null)
- return false;
- if (x.GetType() != y.GetType())
- return false;
- return
- string.Equals(x.Host, y.Host, StringComparison.OrdinalIgnoreCase) &&
- x.Port == y.Port;
- }
-
- public int GetHashCode(DnsEndPoint obj) {
- unchecked {
- return (StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Host) * 397) ^
- obj.Port;
- }
- }
- }
- }
-}
diff --git a/src/EventStore.Client/Core/ChannelFactory.cs b/src/EventStore.Client/Core/ChannelFactory.cs
deleted file mode 100644
index 0dc28ee8e..000000000
--- a/src/EventStore.Client/Core/ChannelFactory.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System.Net.Http;
-using System.Security.Cryptography.X509Certificates;
-using Grpc.Net.Client;
-using EndPoint = System.Net.EndPoint;
-using TChannel = Grpc.Net.Client.GrpcChannel;
-
-namespace EventStore.Client {
-
- internal static class ChannelFactory {
- private const int MaxReceiveMessageLength = 17 * 1024 * 1024;
-
- public static TChannel CreateChannel(EventStoreClientSettings settings, EndPoint endPoint) {
- var address = endPoint.ToUri(!settings.ConnectivitySettings.Insecure);
-
- if (settings.ConnectivitySettings.Insecure) {
- //this must be switched on before creation of the HttpMessageHandler
- AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
- }
-
- return TChannel.ForAddress(
- address,
- new GrpcChannelOptions {
-#if NET48
- HttpHandler = CreateHandler(settings),
-#else
- HttpClient = new HttpClient(CreateHandler(settings), true) {
- Timeout = System.Threading.Timeout.InfiniteTimeSpan,
- DefaultRequestVersion = new Version(2, 0)
- },
-#endif
- LoggerFactory = settings.LoggerFactory,
- Credentials = settings.ChannelCredentials,
- DisposeHttpClient = true,
- MaxReceiveMessageSize = MaxReceiveMessageLength
- }
- );
-
-
-#if NET48
- static HttpMessageHandler CreateHandler(EventStoreClientSettings settings) {
- if (settings.CreateHttpMessageHandler is not null)
- return settings.CreateHttpMessageHandler.Invoke();
-
- var handler = new WinHttpHandler {
- TcpKeepAliveEnabled = true,
- TcpKeepAliveTime = settings.ConnectivitySettings.KeepAliveTimeout,
- TcpKeepAliveInterval = settings.ConnectivitySettings.KeepAliveInterval,
- EnableMultipleHttp2Connections = true
- };
-
- if (settings.ConnectivitySettings.Insecure) return handler;
-
- if (settings.ConnectivitySettings.ClientCertificate is not null)
- handler.ClientCertificates.Add(settings.ConnectivitySettings.ClientCertificate);
-
- handler.ServerCertificateValidationCallback = settings.ConnectivitySettings.TlsVerifyCert switch {
- false => delegate { return true; },
- true when settings.ConnectivitySettings.TlsCaFile is not null => (sender, certificate, chain, errors) => {
- if (chain is null) return false;
-
- chain.ChainPolicy.ExtraStore.Add(settings.ConnectivitySettings.TlsCaFile);
- return chain.Build(certificate);
- },
- _ => null
- };
-
- return handler;
- }
-#else
- static HttpMessageHandler CreateHandler(EventStoreClientSettings settings) {
- if (settings.CreateHttpMessageHandler is not null)
- return settings.CreateHttpMessageHandler.Invoke();
-
- var handler = new SocketsHttpHandler {
- KeepAlivePingDelay = settings.ConnectivitySettings.KeepAliveInterval,
- KeepAlivePingTimeout = settings.ConnectivitySettings.KeepAliveTimeout,
- EnableMultipleHttp2Connections = true
- };
-
- if (settings.ConnectivitySettings.Insecure)
- return handler;
-
- if (settings.ConnectivitySettings.ClientCertificate is not null) {
- handler.SslOptions.ClientCertificates = new X509CertificateCollection {
- settings.ConnectivitySettings.ClientCertificate
- };
- }
-
- handler.SslOptions.RemoteCertificateValidationCallback = settings.ConnectivitySettings.TlsVerifyCert switch {
- false => delegate { return true; },
- true when settings.ConnectivitySettings.TlsCaFile is not null => (sender, certificate, chain, errors) => {
- if (certificate is not X509Certificate2 peerCertificate || chain is null) return false;
-
- chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
- chain.ChainPolicy.CustomTrustStore.Add(settings.ConnectivitySettings.TlsCaFile);
- return chain.Build(peerCertificate);
- },
- _ => null
- };
-
- return handler;
- }
-#endif
- }
- }
-}
diff --git a/src/EventStore.Client/Core/ChannelInfo.cs b/src/EventStore.Client/Core/ChannelInfo.cs
deleted file mode 100644
index 87c80b644..000000000
--- a/src/EventStore.Client/Core/ChannelInfo.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Grpc.Core;
-
-namespace EventStore.Client {
-#pragma warning disable 1591
- public record ChannelInfo(
- ChannelBase Channel,
- ServerCapabilities ServerCapabilities,
- CallInvoker CallInvoker);
-}
diff --git a/src/EventStore.Client/Core/ChannelSelector.cs b/src/EventStore.Client/Core/ChannelSelector.cs
deleted file mode 100644
index 354c0a9f5..000000000
--- a/src/EventStore.Client/Core/ChannelSelector.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Net;
-using System.Threading;
-using System.Threading.Tasks;
-using Grpc.Core;
-
-namespace EventStore.Client {
- internal class ChannelSelector : IChannelSelector {
- private readonly IChannelSelector _inner;
-
- public ChannelSelector(
- EventStoreClientSettings settings,
- ChannelCache channelCache) {
- _inner = settings.ConnectivitySettings.IsSingleNode
- ? new SingleNodeChannelSelector(settings, channelCache)
- : new GossipChannelSelector(settings, channelCache, new GrpcGossipClient(settings));
- }
-
- public Task SelectChannelAsync(CancellationToken cancellationToken) =>
- _inner.SelectChannelAsync(cancellationToken);
-
- public ChannelBase SelectChannel(DnsEndPoint endPoint) =>
- _inner.SelectChannel(endPoint);
- }
-}
diff --git a/src/EventStore.Client/Core/ClusterMessage.cs b/src/EventStore.Client/Core/ClusterMessage.cs
deleted file mode 100644
index 64701781e..000000000
--- a/src/EventStore.Client/Core/ClusterMessage.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Net;
-
-namespace EventStore.Client {
- internal static class ClusterMessages {
- public record ClusterInfo(MemberInfo[] Members);
-
- public record MemberInfo(Uuid InstanceId, VNodeState State, bool IsAlive, DnsEndPoint EndPoint);
-
- public enum VNodeState {
- Initializing = 0,
- DiscoverLeader = 1,
- Unknown = 2,
- PreReplica = 3,
- CatchingUp = 4,
- Clone = 5,
- Follower = 6,
- PreLeader = 7,
- Leader = 8,
- Manager = 9,
- ShuttingDown = 10,
- Shutdown = 11,
- ReadOnlyLeaderless = 12,
- PreReadOnlyReplica = 13,
- ReadOnlyReplica = 14,
- ResigningLeader = 15
- }
- }
-}
diff --git a/src/EventStore.Client/Core/Common/AsyncStreamReaderExtensions.cs b/src/EventStore.Client/Core/Common/AsyncStreamReaderExtensions.cs
deleted file mode 100644
index 98f9de54d..000000000
--- a/src/EventStore.Client/Core/Common/AsyncStreamReaderExtensions.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.Threading.Channels;
-using System.Runtime.CompilerServices;
-using Grpc.Core;
-
-namespace EventStore.Client;
-
-static class AsyncStreamReaderExtensions {
- public static async IAsyncEnumerable ReadAllAsync(
- this IAsyncStreamReader reader,
- [EnumeratorCancellation]
- CancellationToken cancellationToken = default
- ) {
- while (await reader.MoveNext(cancellationToken).ConfigureAwait(false))
- yield return reader.Current;
- }
-
- public static async IAsyncEnumerable ReadAllAsync(this ChannelReader reader, [EnumeratorCancellation] CancellationToken cancellationToken = default) {
-#if NET
- await foreach (var item in reader.ReadAllAsync(cancellationToken))
- yield return item;
-#else
- while (await reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) {
- while (reader.TryRead(out T? item)) {
- yield return item;
- }
- }
-#endif
- }
-}
diff --git a/src/EventStore.Client/Core/Common/Constants.cs b/src/EventStore.Client/Core/Common/Constants.cs
deleted file mode 100644
index 2ed9d7c82..000000000
--- a/src/EventStore.Client/Core/Common/Constants.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-namespace EventStore.Client;
-
-static class Constants {
- public static class Exceptions {
- public const string ExceptionKey = "exception";
-
- public const string AccessDenied = "access-denied";
- public const string InvalidTransaction = "invalid-transaction";
- public const string StreamDeleted = "stream-deleted";
- public const string WrongExpectedVersion = "wrong-expected-version";
- public const string StreamNotFound = "stream-not-found";
- public const string MaximumAppendSizeExceeded = "maximum-append-size-exceeded";
- public const string MissingRequiredMetadataProperty = "missing-required-metadata-property";
- public const string NotLeader = "not-leader";
-
- public const string PersistentSubscriptionFailed = "persistent-subscription-failed";
- public const string PersistentSubscriptionDoesNotExist = "persistent-subscription-does-not-exist";
- public const string PersistentSubscriptionExists = "persistent-subscription-exists";
- public const string MaximumSubscribersReached = "maximum-subscribers-reached";
- public const string PersistentSubscriptionDropped = "persistent-subscription-dropped";
-
- public const string UserNotFound = "user-not-found";
- public const string UserConflict = "user-conflict";
-
- public const string ScavengeNotFound = "scavenge-not-found";
-
- public const string ExpectedVersion = "expected-version";
- public const string ActualVersion = "actual-version";
- public const string StreamName = "stream-name";
- public const string GroupName = "group-name";
- public const string Reason = "reason";
- public const string MaximumAppendSize = "maximum-append-size";
- public const string RequiredMetadataProperties = "required-metadata-properties";
- public const string ScavengeId = "scavenge-id";
- public const string LeaderEndpointHost = "leader-endpoint-host";
- public const string LeaderEndpointPort = "leader-endpoint-port";
-
- public const string LoginName = "login-name";
- }
-
- public static class Metadata {
- public const string Type = "type";
- public const string Created = "created";
- public const string ContentType = "content-type";
-
- public static readonly string[] RequiredMetadata = [Type, ContentType];
-
- public static class ContentTypes {
- public const string ApplicationJson = "application/json";
- public const string ApplicationOctetStream = "application/octet-stream";
- }
- }
-
- public static class Headers {
- public const string Authorization = "authorization";
- public const string BasicScheme = "Basic";
- public const string BearerScheme = "Bearer";
-
- public const string ConnectionName = "connection-name";
- public const string RequiresLeader = "requires-leader";
- }
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/ActivitySourceExtensions.cs b/src/EventStore.Client/Core/Common/Diagnostics/ActivitySourceExtensions.cs
deleted file mode 100644
index 71f4372da..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/ActivitySourceExtensions.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
-
-using System.Diagnostics;
-using EventStore.Diagnostics;
-using EventStore.Diagnostics.Telemetry;
-using EventStore.Diagnostics.Tracing;
-
-namespace EventStore.Client.Diagnostics;
-
-static class ActivitySourceExtensions {
- public static async ValueTask TraceClientOperation(
- this ActivitySource source,
- Func> tracedOperation,
- string operationName,
- Func? tagsFactory = null
- ) {
- if (source.HasNoActiveListeners())
- return await tracedOperation().ConfigureAwait(false);
-
- var tags = tagsFactory?.Invoke();
-
- using var activity = StartActivity(source, operationName, ActivityKind.Client, tags, Activity.Current?.Context);
-
- try {
- var res = await tracedOperation().ConfigureAwait(false);
- activity?.StatusOk();
- return res;
- } catch (Exception ex) {
- activity?.StatusError(ex);
- throw;
- }
- }
-
- public static void TraceSubscriptionEvent(
- this ActivitySource source,
- string? subscriptionId,
- ResolvedEvent resolvedEvent,
- ChannelInfo channelInfo,
- EventStoreClientSettings settings,
- UserCredentials? userCredentials
- ) {
- if (source.HasNoActiveListeners() || resolvedEvent.Event is null)
- return;
-
- var parentContext = resolvedEvent.Event.Metadata.ExtractPropagationContext();
-
- if (parentContext == default(ActivityContext)) return;
-
- var tags = new ActivityTagsCollection()
- .WithRequiredTag(TelemetryTags.EventStore.Stream, resolvedEvent.OriginalEvent.EventStreamId)
- .WithOptionalTag(TelemetryTags.EventStore.SubscriptionId, subscriptionId)
- .WithRequiredTag(TelemetryTags.EventStore.EventId, resolvedEvent.OriginalEvent.EventId.ToString())
- .WithRequiredTag(TelemetryTags.EventStore.EventType, resolvedEvent.OriginalEvent.EventType)
- // Ensure consistent server.address attribute when connecting to cluster via dns discovery
- .WithGrpcChannelServerTags(settings, channelInfo)
- .WithClientSettingsServerTags(settings)
- .WithOptionalTag(
- TelemetryTags.Database.User,
- userCredentials?.Username ?? settings.DefaultCredentials?.Username
- );
-
- StartActivity(source, TracingConstants.Operations.Subscribe, ActivityKind.Consumer, tags, parentContext)
- ?.Dispose();
- }
-
- static Activity? StartActivity(
- this ActivitySource source,
- string operationName, ActivityKind activityKind, ActivityTagsCollection? tags = null,
- ActivityContext? parentContext = null
- ) {
- if (source.HasNoActiveListeners())
- return null;
-
- (tags ??= new ActivityTagsCollection())
- .WithRequiredTag(TelemetryTags.Database.System, "eventstoredb")
- .WithRequiredTag(TelemetryTags.Database.Operation, operationName);
-
- return source
- .CreateActivity(
- operationName,
- activityKind,
- parentContext ?? default,
- tags,
- idFormat: ActivityIdFormat.W3C
- )
- ?.Start();
- }
-
- static bool HasNoActiveListeners(this ActivitySource source) => !source.HasListeners();
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/ActivityTagsCollectionExtensions.cs b/src/EventStore.Client/Core/Common/Diagnostics/ActivityTagsCollectionExtensions.cs
deleted file mode 100644
index bc3c2aa75..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/ActivityTagsCollectionExtensions.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using EventStore.Diagnostics;
-using EventStore.Diagnostics.Telemetry;
-
-namespace EventStore.Client.Diagnostics;
-
-static class ActivityTagsCollectionExtensions {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ActivityTagsCollection WithGrpcChannelServerTags(this ActivityTagsCollection tags, EventStoreClientSettings settings, ChannelInfo? channelInfo) {
- if (channelInfo is null)
- return tags;
-
- var authorityParts = channelInfo.Channel.Target.Split([':'], StringSplitOptions.RemoveEmptyEntries);
-
- string host = authorityParts[0];
- int port = authorityParts.Length == 1
- ? settings.ConnectivitySettings.Insecure ? 80 : 443
- : int.Parse(authorityParts[1]);
-
- return tags
- .WithRequiredTag(TelemetryTags.Server.Address, host)
- .WithRequiredTag(TelemetryTags.Server.Port, port);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ActivityTagsCollection WithClientSettingsServerTags(this ActivityTagsCollection source, EventStoreClientSettings settings) {
- if (settings.ConnectivitySettings.DnsGossipSeeds?.Length != 1)
- return source;
-
- var gossipSeed = settings.ConnectivitySettings.DnsGossipSeeds[0];
-
- return source
- .WithRequiredTag(TelemetryTags.Server.Address, gossipSeed.Host)
- .WithRequiredTag(TelemetryTags.Server.Port, gossipSeed.Port);
- }
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityExtensions.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityExtensions.cs
deleted file mode 100644
index 4594d1000..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityExtensions.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-// ReSharper disable CheckNamespace
-
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using EventStore.Diagnostics.Telemetry;
-using EventStore.Diagnostics.Tracing;
-
-namespace EventStore.Diagnostics;
-
-static class ActivityExtensions {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static TracingMetadata GetTracingMetadata(this Activity activity) =>
- new(activity.TraceId.ToString(), activity.SpanId.ToString());
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Activity StatusOk(this Activity activity, string? description = null) =>
- activity.SetActivityStatus(ActivityStatus.Ok(description));
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Activity StatusError(this Activity activity, Exception exception) =>
- activity.SetActivityStatus(ActivityStatus.Error(exception));
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- static Activity RecordException(this Activity activity, Exception? exception) {
- if (exception is null) return activity;
-
- var ex = exception is AggregateException aex ? aex.Flatten() : exception;
-
- var tags = new ActivityTagsCollection {
- { TelemetryTags.Exception.Type, ex.GetType().FullName },
- { TelemetryTags.Exception.Stacktrace, ex.ToInvariantString() }
- };
-
- if (!string.IsNullOrWhiteSpace(exception.Message))
- tags.Add(TelemetryTags.Exception.Message, ex.Message);
-
- activity.AddEvent(new ActivityEvent(TelemetryTags.Exception.EventName, default, tags));
-
- return activity;
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- static Activity SetActivityStatus(this Activity activity, ActivityStatus status) {
- var statusCode = ActivityStatusCodeHelper.GetTagValueForStatusCode(status.StatusCode);
-
- activity.SetStatus(status.StatusCode, status.Description);
- activity.SetTag(TelemetryTags.Otel.StatusCode, statusCode);
- activity.SetTag(TelemetryTags.Otel.StatusDescription, status.Description);
-
- return activity.IsAllDataRequested ? activity.RecordException(status.Exception) : activity;
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityStatus.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityStatus.cs
deleted file mode 100644
index a25b7326f..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityStatus.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// ReSharper disable CheckNamespace
-
-using System.Diagnostics;
-
-namespace EventStore.Diagnostics;
-
-record ActivityStatus(ActivityStatusCode StatusCode, string? Description, Exception? Exception) {
- public static ActivityStatus Ok(string? description = null) =>
- new(ActivityStatusCode.Ok, description, null);
-
- public static ActivityStatus Error(Exception exception, string? description = null) =>
- new(ActivityStatusCode.Error, description ?? exception.Message, exception);
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityStatusCodeHelper.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityStatusCodeHelper.cs
deleted file mode 100644
index 77810aa6c..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityStatusCodeHelper.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// ReSharper disable CheckNamespace
-
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-
-using static System.Diagnostics.ActivityStatusCode;
-using static System.StringComparison;
-
-namespace EventStore.Diagnostics;
-
-static class ActivityStatusCodeHelper {
- public const string UnsetStatusCodeTagValue = "UNSET";
- public const string OkStatusCodeTagValue = "OK";
- public const string ErrorStatusCodeTagValue = "ERROR";
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static string? GetTagValueForStatusCode(ActivityStatusCode statusCode) =>
- statusCode switch {
- Unset => UnsetStatusCodeTagValue,
- Error => ErrorStatusCodeTagValue,
- Ok => OkStatusCodeTagValue,
- _ => null
- };
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityTagsCollectionExtensions.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityTagsCollectionExtensions.cs
deleted file mode 100644
index 15aa0662e..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/ActivityTagsCollectionExtensions.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// ReSharper disable CheckNamespace
-
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-
-namespace EventStore.Diagnostics;
-
-static class ActivityTagsCollectionExtensions {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ActivityTagsCollection WithRequiredTag(this ActivityTagsCollection source, string key, object? value) {
- source[key] = value ?? throw new ArgumentNullException(key);
- return source;
- }
-
- ///
- /// - If the key previously existed in the collection and the value is , the collection item matching the key will get removed from the collection.
- /// - If the key previously existed in the collection and the value is not , the value will replace the old value stored in the collection.
- /// - Otherwise, a new item will get added to the collection.
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ActivityTagsCollection WithOptionalTag(this ActivityTagsCollection source, string key, object? value) {
- source[key] = value;
- return source;
- }
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/ExceptionExtensions.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/ExceptionExtensions.cs
deleted file mode 100644
index 8403c3c01..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/ExceptionExtensions.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// ReSharper disable CheckNamespace
-
-using System.Globalization;
-
-namespace EventStore.Diagnostics;
-
-static class ExceptionExtensions {
- ///
- /// Returns a culture-independent string representation of the given object,
- /// appropriate for diagnostics tracing.
- ///
- /// Exception to convert to string.
- /// Exception as string with no culture.
- public static string ToInvariantString(this Exception exception) {
- var originalUiCulture = Thread.CurrentThread.CurrentUICulture;
-
- try {
- Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
- return exception.ToString();
- }
- finally {
- Thread.CurrentThread.CurrentUICulture = originalUiCulture;
- }
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/Telemetry/TelemetryTags.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/Telemetry/TelemetryTags.cs
deleted file mode 100644
index f7d5e4b17..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/Telemetry/TelemetryTags.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// ReSharper disable CheckNamespace
-
-namespace EventStore.Diagnostics.Telemetry;
-
-// The attributes below match the specification of v1.24.0 of the Open Telemetry semantic conventions.
-// Some attributes are ignored where not required or relevant.
-// https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/general/trace.md
-// https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md
-// https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/exceptions/exceptions-spans.md
-
-static partial class TelemetryTags {
- public static class Database {
- public const string User = "db.user";
- public const string System = "db.system";
- public const string Operation = "db.operation";
- }
-
- public static class Server {
- public const string Address = "server.address";
- public const string Port = "server.port";
- public const string SocketAddress = "server.socket.address"; // replaces: "net.peer.ip" (AttributeNetPeerIp)
- }
-
- public static class Exception {
- public const string EventName = "exception";
- public const string Type = "exception.type";
- public const string Message = "exception.message";
- public const string Stacktrace = "exception.stacktrace";
- }
-
- public static class Otel {
- public const string StatusCode = "otel.status_code";
- public const string StatusDescription = "otel.status_description";
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/Tracing/TracingConstants.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/Tracing/TracingConstants.cs
deleted file mode 100644
index 26aa2be21..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/Tracing/TracingConstants.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// ReSharper disable CheckNamespace
-
-namespace EventStore.Diagnostics.Tracing;
-
-static partial class TracingConstants {
- public static class Metadata {
- public const string TraceId = "$traceId";
- public const string SpanId = "$spanId";
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Core/Tracing/TracingMetadata.cs b/src/EventStore.Client/Core/Common/Diagnostics/Core/Tracing/TracingMetadata.cs
deleted file mode 100644
index ecb9c68c6..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Core/Tracing/TracingMetadata.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// ReSharper disable CheckNamespace
-
-using System.Diagnostics;
-using System.Text.Json.Serialization;
-
-namespace EventStore.Diagnostics.Tracing;
-
-readonly record struct TracingMetadata(
- [property: JsonPropertyName(TracingConstants.Metadata.TraceId)]
- string? TraceId,
- [property: JsonPropertyName(TracingConstants.Metadata.SpanId)]
- string? SpanId
-) {
- public static readonly TracingMetadata None = new(null, null);
-
- [JsonIgnore] public bool IsValid => TraceId != null && SpanId != null;
-
- public ActivityContext? ToActivityContext(bool isRemote = true) {
- try {
- return IsValid
- ? new ActivityContext(
- ActivityTraceId.CreateFromString(new ReadOnlySpan(TraceId!.ToCharArray())),
- ActivitySpanId.CreateFromString(new ReadOnlySpan(SpanId!.ToCharArray())),
- ActivityTraceFlags.Recorded,
- isRemote: isRemote
- )
- : default;
- } catch (Exception) {
- return default;
- }
- }
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/EventMetadataExtensions.cs b/src/EventStore.Client/Core/Common/Diagnostics/EventMetadataExtensions.cs
deleted file mode 100644
index 4245d5bb7..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/EventMetadataExtensions.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using System.Text.Json;
-using EventStore.Diagnostics;
-using EventStore.Diagnostics.Tracing;
-
-namespace EventStore.Client.Diagnostics;
-
-static class EventMetadataExtensions {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ReadOnlySpan InjectTracingContext(
- this ReadOnlyMemory eventMetadata, Activity? activity
- ) =>
- eventMetadata.InjectTracingMetadata(activity?.GetTracingMetadata() ?? TracingMetadata.None);
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static ActivityContext? ExtractPropagationContext(this ReadOnlyMemory eventMetadata) =>
- eventMetadata.ExtractTracingMetadata().ToActivityContext(isRemote: true);
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static TracingMetadata ExtractTracingMetadata(this ReadOnlyMemory eventMetadata) {
- if (eventMetadata.IsEmpty)
- return TracingMetadata.None;
-
- var reader = new Utf8JsonReader(eventMetadata.Span);
- try {
- if (!JsonDocument.TryParseValue(ref reader, out var doc))
- return TracingMetadata.None;
-
- using (doc) {
- if (!doc.RootElement.TryGetProperty(TracingConstants.Metadata.TraceId, out var traceId)
- || !doc.RootElement.TryGetProperty(TracingConstants.Metadata.SpanId, out var spanId))
- return TracingMetadata.None;
-
- return new TracingMetadata(traceId.GetString(), spanId.GetString());
- }
- } catch (Exception) {
- return TracingMetadata.None;
- }
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- static ReadOnlySpan InjectTracingMetadata(
- this ReadOnlyMemory eventMetadata, TracingMetadata tracingMetadata
- ) {
- if (tracingMetadata == TracingMetadata.None || !tracingMetadata.IsValid)
- return eventMetadata.Span;
-
- return eventMetadata.IsEmpty
- ? JsonSerializer.SerializeToUtf8Bytes(tracingMetadata)
- : TryInjectTracingMetadata(eventMetadata, tracingMetadata).ToArray();
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- static ReadOnlyMemory TryInjectTracingMetadata(
- this ReadOnlyMemory utf8Json, TracingMetadata tracingMetadata
- ) {
- try {
- using var doc = JsonDocument.Parse(utf8Json);
- using var stream = new MemoryStream();
- using var writer = new Utf8JsonWriter(stream);
-
- writer.WriteStartObject();
-
- if (doc.RootElement.ValueKind != JsonValueKind.Object)
- return utf8Json;
-
- foreach (var prop in doc.RootElement.EnumerateObject())
- prop.WriteTo(writer);
-
- writer.WritePropertyName(TracingConstants.Metadata.TraceId);
- writer.WriteStringValue(tracingMetadata.TraceId);
- writer.WritePropertyName(TracingConstants.Metadata.SpanId);
- writer.WriteStringValue(tracingMetadata.SpanId);
-
- writer.WriteEndObject();
- writer.Flush();
-
- return stream.ToArray();
- } catch (Exception) {
- return utf8Json;
- }
- }
-}
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/EventStoreClientDiagnostics.cs b/src/EventStore.Client/Core/Common/Diagnostics/EventStoreClientDiagnostics.cs
deleted file mode 100644
index 6328387ab..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/EventStoreClientDiagnostics.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System.Diagnostics;
-
-namespace EventStore.Client.Diagnostics;
-
-public static class EventStoreClientDiagnostics {
- public const string InstrumentationName = "eventstoredb";
- public static readonly ActivitySource ActivitySource = new ActivitySource(InstrumentationName);
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Telemetry/TelemetryTags.cs b/src/EventStore.Client/Core/Common/Diagnostics/Telemetry/TelemetryTags.cs
deleted file mode 100644
index ea05d04fa..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Telemetry/TelemetryTags.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// ReSharper disable CheckNamespace
-
-namespace EventStore.Diagnostics.Telemetry;
-
-static partial class TelemetryTags {
- public static class EventStore {
- public const string Stream = "db.eventstoredb.stream";
- public const string SubscriptionId = "db.eventstoredb.subscription.id";
- public const string EventId = "db.eventstoredb.event.id";
- public const string EventType = "db.eventstoredb.event.type";
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Diagnostics/Tracing/TracingConstants.cs b/src/EventStore.Client/Core/Common/Diagnostics/Tracing/TracingConstants.cs
deleted file mode 100644
index e43102ebe..000000000
--- a/src/EventStore.Client/Core/Common/Diagnostics/Tracing/TracingConstants.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// ReSharper disable CheckNamespace
-
-namespace EventStore.Diagnostics.Tracing;
-
-static partial class TracingConstants {
- public static class Operations {
- public const string Append = "streams.append";
- public const string Subscribe = "streams.subscribe";
- }
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/EnumerableTaskExtensions.cs b/src/EventStore.Client/Core/Common/EnumerableTaskExtensions.cs
deleted file mode 100644
index eb4517006..000000000
--- a/src/EventStore.Client/Core/Common/EnumerableTaskExtensions.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Diagnostics;
-
-namespace EventStore.Client;
-
-static class EnumerableTaskExtensions {
- [DebuggerStepThrough]
- public static Task WhenAll(this IEnumerable source) => Task.WhenAll(source);
-
- [DebuggerStepThrough]
- public static Task WhenAll(this IEnumerable> source) => Task.WhenAll(source);
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/EpochExtensions.cs b/src/EventStore.Client/Core/Common/EpochExtensions.cs
deleted file mode 100644
index db59e620d..000000000
--- a/src/EventStore.Client/Core/Common/EpochExtensions.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace EventStore.Client;
-
-static class EpochExtensions {
-#if NET
- static readonly DateTime UnixEpoch = DateTime.UnixEpoch;
-#else
- const long TicksPerMillisecond = 10000;
- const long TicksPerSecond = TicksPerMillisecond * 1000;
- const long TicksPerMinute = TicksPerSecond * 60;
- const long TicksPerHour = TicksPerMinute * 60;
- const long TicksPerDay = TicksPerHour * 24;
- const int DaysPerYear = 365;
- const int DaysPer4Years = DaysPerYear * 4 + 1;
- const int DaysPer100Years = DaysPer4Years * 25 - 1;
- const int DaysPer400Years = DaysPer100Years * 4 + 1;
- const int DaysTo1970 = DaysPer400Years * 4 + DaysPer100Years * 3 + DaysPer4Years * 17 + DaysPerYear;
- const long UnixEpochTicks = DaysTo1970 * TicksPerDay;
-
- static readonly DateTime UnixEpoch = new(UnixEpochTicks, DateTimeKind.Utc);
-#endif
-
- public static DateTime FromTicksSinceEpoch(this long value) => new(UnixEpoch.Ticks + value, DateTimeKind.Utc);
-
- public static long ToTicksSinceEpoch(this DateTime value) => (value - UnixEpoch).Ticks;
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/EventStoreCallOptions.cs b/src/EventStore.Client/Core/Common/EventStoreCallOptions.cs
deleted file mode 100644
index e6058a170..000000000
--- a/src/EventStore.Client/Core/Common/EventStoreCallOptions.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using Grpc.Core;
-using static System.Threading.Timeout;
-
-namespace EventStore.Client;
-
-static class EventStoreCallOptions {
- // deadline falls back to infinity
- public static CallOptions CreateStreaming(
- EventStoreClientSettings settings,
- TimeSpan? deadline = null, UserCredentials? userCredentials = null,
- CancellationToken cancellationToken = default
- ) =>
- Create(settings, deadline, userCredentials, cancellationToken);
-
- // deadline falls back to connection DefaultDeadline
- public static CallOptions CreateNonStreaming(
- EventStoreClientSettings settings,
- CancellationToken cancellationToken
- ) =>
- Create(
- settings,
- settings.DefaultDeadline,
- settings.DefaultCredentials,
- cancellationToken
- );
-
- public static CallOptions CreateNonStreaming(
- EventStoreClientSettings settings, TimeSpan? deadline,
- UserCredentials? userCredentials, CancellationToken cancellationToken
- ) =>
- Create(
- settings,
- deadline ?? settings.DefaultDeadline,
- userCredentials,
- cancellationToken
- );
-
- static CallOptions Create(
- EventStoreClientSettings settings, TimeSpan? deadline,
- UserCredentials? userCredentials, CancellationToken cancellationToken
- ) =>
- new(
- cancellationToken: cancellationToken,
- deadline: DeadlineAfter(deadline),
- headers: new() {
- {
- Constants.Headers.RequiresLeader,
- settings.ConnectivitySettings.NodePreference == NodePreference.Leader
- ? bool.TrueString
- : bool.FalseString
- }
- },
- credentials: (userCredentials ?? settings.DefaultCredentials) == null
- ? null
- : CallCredentials.FromInterceptor(
- async (_, metadata) => {
- var credentials = userCredentials ?? settings.DefaultCredentials;
-
- var authorizationHeader = await settings.OperationOptions
- .GetAuthenticationHeaderValue(credentials!, CancellationToken.None)
- .ConfigureAwait(false);
-
- metadata.Add(Constants.Headers.Authorization, authorizationHeader);
- }
- )
- );
-
- static DateTime? DeadlineAfter(TimeSpan? timeoutAfter) =>
- !timeoutAfter.HasValue
- ? new DateTime?()
- : timeoutAfter.Value == TimeSpan.MaxValue || timeoutAfter.Value == InfiniteTimeSpan
- ? DateTime.MaxValue
- : DateTime.UtcNow.Add(timeoutAfter.Value);
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/MetadataExtensions.cs b/src/EventStore.Client/Core/Common/MetadataExtensions.cs
deleted file mode 100644
index e547970fd..000000000
--- a/src/EventStore.Client/Core/Common/MetadataExtensions.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Grpc.Core;
-
-namespace EventStore.Client;
-
-static class MetadataExtensions {
- public static bool TryGetValue(this Metadata metadata, string key, out string? value) {
- value = default;
-
- foreach (var entry in metadata) {
- if (entry.Key != key)
- continue;
-
- value = entry.Value;
- return true;
- }
-
- return false;
- }
-
- public static StreamRevision GetStreamRevision(this Metadata metadata, string key) =>
- metadata.TryGetValue(key, out var s) && ulong.TryParse(s, out var value)
- ? new(value)
- : StreamRevision.None;
-
- public static int GetIntValueOrDefault(this Metadata metadata, string key) =>
- metadata.TryGetValue(key, out var s) && int.TryParse(s, out var value)
- ? value
- : default;
-}
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Shims/Index.cs b/src/EventStore.Client/Core/Common/Shims/Index.cs
deleted file mode 100644
index 357bbd34d..000000000
--- a/src/EventStore.Client/Core/Common/Shims/Index.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-#if !NET
-using System.Runtime.CompilerServices;
-
-namespace System;
-
-/// Represent a type can be used to index a collection either from the start or the end.
-///
-/// Index is used by the C# compiler to support the new index syntax
-///
-/// int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ;
-/// int lastElement = someArray[^1]; // lastElement = 5
-///
-///
-readonly struct Index : IEquatable {
- readonly int _value;
-
- /// Construct an Index using a value and indicating if the index is from the start or from the end.
- /// The index value. it has to be zero or positive number.
- /// Indicating if the index is from the start or from the end.
- ///
- /// If the Index constructed from the end, index value 1 means pointing at the last element and index value 0 means pointing at beyond last element.
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public Index(int value, bool fromEnd = false) {
- if (value < 0) throw new ArgumentOutOfRangeException(nameof(value), "value must be non-negative");
-
- if (fromEnd)
- _value = ~value;
- else
- _value = value;
- }
-
- // The following private constructors mainly created for perf reason to avoid the checks
- Index(int value) => _value = value;
-
- /// Create an Index pointing at first element.
- public static Index Start => new(0);
-
- /// Create an Index pointing at beyond last element.
- public static Index End => new(~0);
-
- /// Create an Index from the start at the position indicated by the value.
- /// The index value from the start.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Index FromStart(int value) {
- if (value < 0) throw new ArgumentOutOfRangeException(nameof(value), "value must be non-negative");
-
- return new Index(value);
- }
-
- /// Create an Index from the end at the position indicated by the value.
- /// The index value from the end.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Index FromEnd(int value) {
- if (value < 0) throw new ArgumentOutOfRangeException(nameof(value), "value must be non-negative");
-
- return new Index(~value);
- }
-
- /// Returns the index value.
- public int Value {
- get {
- if (_value < 0)
- return ~_value;
- else
- return _value;
- }
- }
-
- /// Indicates whether the index is from the start or the end.
- public bool IsFromEnd => _value < 0;
-
- /// Calculate the offset from the start using the giving collection length.
- /// The length of the collection that the Index will be used with. length has to be a positive value
- ///
- /// For performance reason, we don't validate the input length parameter and the returned offset value against negative values.
- /// we don't validate either the returned offset is greater than the input length.
- /// It is expected Index will be used with collections which always have non negative length/count. If the returned offset is negative and
- /// then used to index a collection will get out of range exception which will be same affect as the validation.
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public int GetOffset(int length) {
- var offset = _value;
- if (IsFromEnd)
- // offset = length - (~value)
- // offset = length + (~(~value) + 1)
- // offset = length + value + 1
- offset += length + 1;
-
- return offset;
- }
-
- /// Indicates whether the current Index object is equal to another object of the same type.
- /// An object to compare with this object
- public override bool Equals(object? value) => value is Index && _value == ((Index)value)._value;
-
- /// Indicates whether the current Index object is equal to another Index object.
- /// An object to compare with this object
- public bool Equals(Index other) => _value == other._value;
-
- /// Returns the hash code for this instance.
- public override int GetHashCode() => _value;
-
- /// Converts integer number to an Index.
- public static implicit operator Index(int value) => FromStart(value);
-
- /// Converts the value of the current Index object to its equivalent string representation.
- public override string ToString() => IsFromEnd ? $"^{(uint)Value}" : ((uint)Value).ToString();
-}
-#endif
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Shims/IsExternalInit.cs b/src/EventStore.Client/Core/Common/Shims/IsExternalInit.cs
deleted file mode 100644
index 7dc4fea3d..000000000
--- a/src/EventStore.Client/Core/Common/Shims/IsExternalInit.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-#if !NET
-
-using System.ComponentModel;
-
-// ReSharper disable once CheckNamespace
-namespace System.Runtime.CompilerServices;
-
-[EditorBrowsable(EditorBrowsableState.Never)]
-class IsExternalInit{}
-#endif
diff --git a/src/EventStore.Client/Core/Common/Shims/Range.cs b/src/EventStore.Client/Core/Common/Shims/Range.cs
deleted file mode 100644
index 3a0b34fde..000000000
--- a/src/EventStore.Client/Core/Common/Shims/Range.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-#if !NET
-// ReSharper disable CheckNamespace
-
-using System.Runtime.CompilerServices;
-
-namespace System;
-
-/// Represent a range has start and end indexes.
-///
-/// Range is used by the C# compiler to support the range syntax.
-///
-/// int[] someArray = new int[5] { 1, 2, 3, 4, 5 };
-/// int[] subArray1 = someArray[0..2]; // { 1, 2 }
-/// int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 }
-///
-///
-readonly struct Range : IEquatable {
- /// Represent the inclusive start index of the Range.
- public Index Start { get; }
-
- /// Represent the exclusive end index of the Range.
- public Index End { get; }
-
- /// Construct a Range object using the start and end indexes.
- /// Represent the inclusive start index of the range.
- /// Represent the exclusive end index of the range.
- public Range(Index start, Index end) {
- Start = start;
- End = end;
- }
-
- /// Indicates whether the current Range object is equal to another object of the same type.
- /// An object to compare with this object
- public override bool Equals(object? value) =>
- value is Range r &&
- r.Start.Equals(Start) &&
- r.End.Equals(End);
-
- /// Indicates whether the current Range object is equal to another Range object.
- /// An object to compare with this object
- public bool Equals(Range other) => other.Start.Equals(Start) && other.End.Equals(End);
-
- /// Returns the hash code for this instance.
- public override int GetHashCode() => Start.GetHashCode() * 31 + End.GetHashCode();
-
- /// Converts the value of the current Range object to its equivalent string representation.
- public override string ToString() => $"{Start}..{End}";
-
- /// Create a Range object starting from start index to the end of the collection.
- public static Range StartAt(Index start) => new(start, Index.End);
-
- /// Create a Range object starting from first element in the collection to the end Index.
- public static Range EndAt(Index end) => new(Index.Start, end);
-
- /// Create a Range object starting from first element to the end.
- public static Range All => new(Index.Start, Index.End);
-
- /// Calculate the start offset and length of range object using a collection length.
- /// The length of the collection that the range will be used with. length has to be a positive value.
- ///
- /// For performance reason, we don't validate the input length parameter against negative values.
- /// It is expected Range will be used with collections which always have non negative length/count.
- /// We validate the range is inside the length scope though.
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public (int Offset, int Length) GetOffsetAndLength(int length) {
- var start = Start.GetOffset(length);
- var end = End.GetOffset(length);
-
- if ((uint)end > (uint)length || (uint)start > (uint)end) throw new ArgumentOutOfRangeException(nameof(length));
-
- return (start, end - start);
- }
-}
-#endif
\ No newline at end of file
diff --git a/src/EventStore.Client/Core/Common/Shims/TaskCompletionSource.cs b/src/EventStore.Client/Core/Common/Shims/TaskCompletionSource.cs
deleted file mode 100644
index ad6573c4a..000000000
--- a/src/EventStore.Client/Core/Common/Shims/TaskCompletionSource.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-#if !NET
-// ReSharper disable CheckNamespace
-
-namespace System.Threading.Tasks;
-
-class TaskCompletionSource : TaskCompletionSource