diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml
index 48038fc6f..b9b042301 100644
--- a/.github/workflows/base.yml
+++ b/.github/workflows/base.yml
@@ -13,10 +13,10 @@ jobs:
strategy:
fail-fast: false
matrix:
- framework: [net5.0, net6.0, net7.0]
- os: [ubuntu-latest]
- test: [Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement]
- configuration: [release]
+ framework: [ net5.0, net6.0, net7.0 ]
+ os: [ ubuntu-latest ]
+ test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ]
+ configuration: [ release ]
runs-on: ${{ matrix.os }}
name: EventStore.Client.${{ matrix.test }}/${{ matrix.os }}/${{ matrix.framework }}/${{ inputs.docker-tag }}
steps:
diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml
index eb74a9462..927050291 100644
--- a/.github/workflows/dispatch.yml
+++ b/.github/workflows/dispatch.yml
@@ -1,15 +1,15 @@
name: "Dispatch"
on:
- workflow_dispatch:
- inputs:
- version:
- description: "Docker tag version"
- required: true
- type: string
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Docker tag version"
+ required: true
+ type: string
jobs:
- test:
- uses: ./.github/workflows/base.yml
- with:
- docker-tag: ${{ inputs.version }}
+ test:
+ uses: ./.github/workflows/base.yml
+ with:
+ docker-tag: ${{ inputs.version }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 28dc70ccf..f3d7df4f9 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -75,13 +75,13 @@ jobs:
find samples/ -type f -iname "*.csproj" -print0 | xargs -0L1 dotnet run --framework ${{ matrix.framework }} --project
test:
- timeout-minutes: 10
+ timeout-minutes: 20
strategy:
fail-fast: false
matrix:
- framework: [net5.0, net6.0, net7.0]
- os: [ubuntu-latest, windows-latest]
- configuration: [release]
+ framework: [ net5.0, net6.0, net7.0 ]
+ os: [ ubuntu-latest, windows-latest ]
+ configuration: [ release ]
runs-on: ${{ matrix.os }}
name: test/EventStore.Client/${{ matrix.os }}/${{ matrix.framework }}
steps:
@@ -161,5 +161,4 @@ jobs:
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
-
+ find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.nuget_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate
\ No newline at end of file
diff --git a/Directory.Build.props b/Directory.Build.props
index 20ce0fd68..3ed57a184 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,19 +1,20 @@
-
- net5.0;net6.0;net7.0
- x64
- true
- enable
- enable
- true
- 11
- Debug
- full
- pdbonly
- $(MSBuildThisFileDirectory)\bin\$(Configuration)\$(MSBuildProjectName)\
- EventStore.Client
- true
- 2.49.0
- 2.50.0
-
+
+ net5.0;net6.0;net7.0;
+ x64
+ true
+ enable
+ enable
+ true
+ true
+ preview
+
+ Debug
+ full
+ pdbonly
+
+ true
+ 2.49.0
+ 2.50.0
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 80ae31a5f..75a7fa9c1 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,5 +1,5 @@
-
- true
-
+
+ true
+
diff --git a/EventStore.Client.sln b/EventStore.Client.sln
index 83ccb0d56..51229f72c 100644
--- a/EventStore.Client.sln
+++ b/EventStore.Client.sln
@@ -31,9 +31,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventStore.Client.Persisten
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventStore.Client.UserManagement.Tests", "test\EventStore.Client.UserManagement.Tests\EventStore.Client.UserManagement.Tests.csproj", "{22634CEE-4F7B-4679-A48D-38A2A8580ECA}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "generators", "generators", "{57BAB29D-F8A8-47C7-B426-89A1929ADD70}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventStore.Tests.SourceGenerators", "generators\EventStore.Tests.SourceGenerators\EventStore.Tests.SourceGenerators.csproj", "{5912BD08-DA99-49B7-A2C0-C1BA42D209CB}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventStore.Client.Tests.Common", "test\EventStore.Client.Tests.Common\EventStore.Client.Tests.Common.csproj", "{E326832D-DE52-4DE4-9E54-C800908B75F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -92,10 +90,10 @@ Global
{22634CEE-4F7B-4679-A48D-38A2A8580ECA}.Debug|x64.Build.0 = Debug|Any CPU
{22634CEE-4F7B-4679-A48D-38A2A8580ECA}.Release|x64.ActiveCfg = Release|Any CPU
{22634CEE-4F7B-4679-A48D-38A2A8580ECA}.Release|x64.Build.0 = Release|Any CPU
- {5912BD08-DA99-49B7-A2C0-C1BA42D209CB}.Debug|x64.ActiveCfg = Debug|Any CPU
- {5912BD08-DA99-49B7-A2C0-C1BA42D209CB}.Debug|x64.Build.0 = Debug|Any CPU
- {5912BD08-DA99-49B7-A2C0-C1BA42D209CB}.Release|x64.ActiveCfg = Release|Any CPU
- {5912BD08-DA99-49B7-A2C0-C1BA42D209CB}.Release|x64.Build.0 = Release|Any CPU
+ {E326832D-DE52-4DE4-9E54-C800908B75F3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E326832D-DE52-4DE4-9E54-C800908B75F3}.Debug|x64.Build.0 = Debug|Any CPU
+ {E326832D-DE52-4DE4-9E54-C800908B75F3}.Release|x64.ActiveCfg = Release|Any CPU
+ {E326832D-DE52-4DE4-9E54-C800908B75F3}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D3744A86-DD35-4104-AAEE-84B79062C4A2} = {EA59C1CB-16DA-4F68-AF8A-642A969B4CF8}
@@ -110,6 +108,6 @@ Global
{FC829F1B-43AD-4C96-9002-23D04BBA3AF3} = {C51F2C69-45A9-4D0D-A708-4FC319D5D340}
{6CEB731F-72E1-461F-A6B3-54DBF3FD786C} = {C51F2C69-45A9-4D0D-A708-4FC319D5D340}
{22634CEE-4F7B-4679-A48D-38A2A8580ECA} = {C51F2C69-45A9-4D0D-A708-4FC319D5D340}
- {5912BD08-DA99-49B7-A2C0-C1BA42D209CB} = {57BAB29D-F8A8-47C7-B426-89A1929ADD70}
+ {E326832D-DE52-4DE4-9E54-C800908B75F3} = {C51F2C69-45A9-4D0D-A708-4FC319D5D340}
EndGlobalSection
EndGlobal
diff --git a/EventStore.Client.sln.DotSettings b/EventStore.Client.sln.DotSettings
new file mode 100644
index 000000000..16d970453
--- /dev/null
+++ b/EventStore.Client.sln.DotSettings
@@ -0,0 +1,405 @@
+
+ 1000
+ 3000
+ 5000
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+
+ True
+
+ True
+ <?xml version="1.0" encoding="utf-16"?><Profile name="EventStore"><XMLReformatCode>True</XMLReformatCode><HtmlReformatCode>True</HtmlReformatCode><CSReformatCode>True</CSReformatCode><CSCodeStyleAttributes ArrangeVarStyle="True" ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" ArrangeArgumentsStyle="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeCodeBodyStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" /><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CppCodeStyleCleanupDescriptor /><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSReorderTypeMembers>True</CSReorderTypeMembers><IDEA_SETTINGS><profile version="1.0">
+ <option name="myName" value="EventStore" />
+ <inspection_tool class="ES6ShorthandObjectProperty" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSRemoveUnnecessaryParentheses" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSUnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="TypeScriptExplicitMemberType" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryContinueJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelOnBreakStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelOnContinueStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryReturnJS" enabled="false" level="WARNING" enabled_by_default="false" />
+</profile></IDEA_SETTINGS><RIDER_SETTINGS><profile>
+ <Language id="CSS">
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="EditorConfig">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="HTML">
+ <OptimizeImports>false</OptimizeImports>
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="HTTP Request">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Handlebars">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Ini">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="JSON">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Jade">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="JavaScript">
+ <OptimizeImports>false</OptimizeImports>
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Markdown">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Properties">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="RELAX-NG">
+ <Reformat>false</Reformat>
+ </Language>
+ <Language id="SQL">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="VueExpr">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="XML">
+ <OptimizeImports>false</OptimizeImports>
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="yaml">
+ <Reformat>true</Reformat>
+ </Language>
+</profile></RIDER_SETTINGS></Profile>
+
+ True
+
+ EventStore
+ ExpressionBody
+ Implicit
+ Implicit
+ ExpressionBody
+ ExpressionBody
+ BaseClass
+ 0
+ 1
+ 0
+ Tab
+ False
+ True
+ False
+ False
+ True
+ END_OF_LINE
+ END_OF_LINE
+ True
+ False
+ True
+ True
+ True
+ False
+ True
+ True
+ END_OF_LINE
+ 1
+ 1
+ END_OF_LINE
+ TOGETHER
+ END_OF_LINE
+ True
+ True
+ True
+ True
+ True
+ False
+ True
+ True
+ True
+ True
+ True
+ END_OF_LINE
+ 1
+ 1
+ False
+ 6
+ 10
+ 6
+ 6
+ 10
+ EXPANDED
+ END_OF_LINE
+ True
+ True
+ True
+ IF_OWNER_IS_SINGLE_LINE
+ IF_OWNER_IS_SINGLE_LINE
+ True
+ END_OF_LINE
+ True
+ True
+ CHOP_IF_LONG
+ CHOP_IF_LONG
+ True
+ True
+ True
+ False
+ CHOP_IF_LONG
+ WRAP_IF_LONG
+ CHOP_IF_LONG
+ <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
+ <TypePattern DisplayName="Non-reorderable types">
+ <TypePattern.Match>
+ <Or>
+ <And>
+ <Kind Is="Interface" />
+ <Or>
+ <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
+ <HasAttribute Name="System.Runtime.InteropServices.ComImport" />
+ </Or>
+ </And>
+ <Kind Is="Struct" />
+ <HasAttribute Name="JetBrains.Annotations.NoReorderAttribute" />
+ <HasAttribute Name="JetBrains.Annotations.NoReorder" />
+ </Or>
+ </TypePattern.Match>
+ </TypePattern>
+
+ <TypePattern DisplayName="xUnit.net Test Classes" RemoveRegions="All">
+ <TypePattern.Match>
+ <And>
+ <Kind Is="Class" />
+ <HasMember>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="Xunit.FactAttribute" Inherited="True" />
+ <HasAttribute Name="Xunit.TheoryAttribute" Inherited="True" />
+ </And>
+ </HasMember>
+ </And>
+ </TypePattern.Match>
+
+ <Entry DisplayName="Setup/Teardown Methods">
+ <Entry.Match>
+ <Or>
+ <Kind Is="Constructor" />
+ <And>
+ <Kind Is="Method" />
+ <ImplementsInterface Name="System.IDisposable" />
+ </And>
+ </Or>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Kind>
+ <Kind.Order>
+ <DeclarationKind>Constructor</DeclarationKind>
+ </Kind.Order>
+ </Kind>
+ </Entry.SortBy>
+ </Entry>
+
+
+ <Entry DisplayName="All other members" />
+
+ <Entry DisplayName="Test Methods" Priority="100">
+ <Entry.Match>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="Xunit.FactAttribute" Inherited="false" />
+ <HasAttribute Name="Xunit.TheoryAttribute" Inherited="false" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+ </TypePattern>
+
+ <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All">
+ <TypePattern.Match>
+ <And>
+ <Kind Is="Class" />
+ <Or>
+ <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TestFixtureSourceAttribute" Inherited="true" />
+ <HasMember>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseSourceAttribute" Inherited="false" />
+ </And>
+ </HasMember>
+ </Or>
+ </And>
+ </TypePattern.Match>
+
+ <Entry DisplayName="Setup/Teardown Methods">
+ <Entry.Match>
+ <And>
+ <Kind Is="Method" />
+ <Or>
+ <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TestFixtureSetUpAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TestFixtureTearDownAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.OneTimeSetUpAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.OneTimeTearDownAttribute" Inherited="true" />
+ </Or>
+ </And>
+ </Entry.Match>
+ </Entry>
+
+ <Entry DisplayName="All other members" />
+
+ <Entry DisplayName="Test Methods" Priority="100">
+ <Entry.Match>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseSourceAttribute" Inherited="false" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+ </TypePattern>
+
+ <TypePattern DisplayName="Default Pattern">
+ <Entry DisplayName="Public Delegates" Priority="100">
+ <Entry.Match>
+ <And>
+ <Access Is="Public" />
+ <Kind Is="Delegate" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Public Enums" Priority="100">
+ <Entry.Match>
+ <And>
+ <Access Is="Public" />
+ <Kind Is="Enum" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Constants" Priority="90">
+ <Entry.Match>
+ <Kind Is="Constant" />
+ </Entry.Match>
+ </Entry>
+
+ <Entry DisplayName="Static Fields" Priority="85">
+ <Entry.Match>
+ <And>
+ <Kind Is="Field" />
+ <Static />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Readonly />
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Fields">
+ <Entry.Match>
+ <And>
+ <Kind Is="Field" />
+ <Not>
+ <Static />
+ </Not>
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Readonly />
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Constructors">
+ <Entry.Match>
+ <Kind Is="Constructor" />
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Static/>
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Properties, Indexers">
+ <Entry.Match>
+ <Or>
+ <Kind Is="Property" />
+ <Kind Is="Indexer" />
+ </Or>
+ </Entry.Match>
+ </Entry>
+
+ <Entry DisplayName="Interface Implementations" Priority="100">
+ <Entry.Match>
+ <And>
+ <Kind Is="Member" />
+ <ImplementsInterface />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <ImplementsInterface Immediate="true" />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="All other members" />
+
+ <Entry DisplayName="Nested Types">
+ <Entry.Match>
+ <Kind Is="Type" />
+ </Entry.Match>
+ </Entry>
+ </TypePattern>
+</Patterns>
+
+ True
+ False
+
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
\ No newline at end of file
diff --git a/gencert.sh b/gencert.sh
index 31ff8bb40..87ca02961 100755
--- a/gencert.sh
+++ b/gencert.sh
@@ -4,10 +4,10 @@ mkdir -p certs
chmod 0755 ./certs
-docker pull eventstore/es-gencert-cli:1.0.1
+docker pull eventstore/es-gencert-cli:1.0.2
-docker run --rm --volume $PWD/certs:/tmp --user $(id -u):$(id -g) eventstore/es-gencert-cli:1.0.1 create-ca -out /tmp/ca
+docker run --rm --volume $PWD/certs:/tmp --user $(id -u):$(id -g) eventstore/es-gencert-cli:1.0.2 create-ca -out /tmp/ca
-docker run --rm --volume $PWD/certs:/tmp --user $(id -u):$(id -g) eventstore/es-gencert-cli:1.0.1 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 --volume $PWD/certs:/tmp --user $(id -u):$(id -g) eventstore/es-gencert-cli:1.0.2 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
-chmod 0755 -R ./certs
+chmod -R 0755 ./certs
diff --git a/generators/EventStore.Tests.SourceGenerators/EventStore.Tests.SourceGenerators.csproj b/generators/EventStore.Tests.SourceGenerators/EventStore.Tests.SourceGenerators.csproj
deleted file mode 100644
index 4ba524437..000000000
--- a/generators/EventStore.Tests.SourceGenerators/EventStore.Tests.SourceGenerators.csproj
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- netstandard2.0
- true
- false
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
-
-
-
diff --git a/generators/EventStore.Tests.SourceGenerators/MsBuildContextSourceGenerator.cs b/generators/EventStore.Tests.SourceGenerators/MsBuildContextSourceGenerator.cs
deleted file mode 100644
index 63bcd1f6a..000000000
--- a/generators/EventStore.Tests.SourceGenerators/MsBuildContextSourceGenerator.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Text;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.Text;
-
-namespace EventStore.Client {
- [Generator]
- public class MsBuildContextSourceGenerator : ISourceGenerator {
- public void Initialize(GeneratorInitializationContext context) {
- }
-
- public void Execute(GeneratorExecutionContext context) {
- context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.RootNamespace",
- out var rootNamespace);
- context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.ProjectDir",
- out var projectDir);
-
- var sourceText = SourceText.From(@$"
-namespace {rootNamespace} {{
- public static class ProjectDir {{
- public static readonly string Current = @""{projectDir}"";
- }}
-}}
-", Encoding.UTF8);
-
- context.AddSource("ProjectDir.cs", sourceText); ;
- }
- }
-}
diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props
index feefe7675..a3644b0a7 100644
--- a/samples/Directory.Build.props
+++ b/samples/Directory.Build.props
@@ -1,8 +1,10 @@
-
- enable
- enable
- Exe
- net5.0;net6.0;net7.0
-
-
+
+ net5.0;net6.0;net7.0
+ enable
+ enable
+ true
+ Exe
+ preview
+
+
\ No newline at end of file
diff --git a/samples/Samples.sln.DotSettings b/samples/Samples.sln.DotSettings
new file mode 100644
index 000000000..16d970453
--- /dev/null
+++ b/samples/Samples.sln.DotSettings
@@ -0,0 +1,405 @@
+
+ 1000
+ 3000
+ 5000
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+
+ True
+
+ True
+ <?xml version="1.0" encoding="utf-16"?><Profile name="EventStore"><XMLReformatCode>True</XMLReformatCode><HtmlReformatCode>True</HtmlReformatCode><CSReformatCode>True</CSReformatCode><CSCodeStyleAttributes ArrangeVarStyle="True" ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" ArrangeArgumentsStyle="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeCodeBodyStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" /><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CppCodeStyleCleanupDescriptor /><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSReorderTypeMembers>True</CSReorderTypeMembers><IDEA_SETTINGS><profile version="1.0">
+ <option name="myName" value="EventStore" />
+ <inspection_tool class="ES6ShorthandObjectProperty" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSRemoveUnnecessaryParentheses" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSUnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="TypeScriptExplicitMemberType" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryContinueJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelOnBreakStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelOnContinueStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryReturnJS" enabled="false" level="WARNING" enabled_by_default="false" />
+</profile></IDEA_SETTINGS><RIDER_SETTINGS><profile>
+ <Language id="CSS">
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="EditorConfig">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="HTML">
+ <OptimizeImports>false</OptimizeImports>
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="HTTP Request">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Handlebars">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Ini">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="JSON">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Jade">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="JavaScript">
+ <OptimizeImports>false</OptimizeImports>
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Markdown">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="Properties">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="RELAX-NG">
+ <Reformat>false</Reformat>
+ </Language>
+ <Language id="SQL">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="VueExpr">
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="XML">
+ <OptimizeImports>false</OptimizeImports>
+ <Rearrange>true</Rearrange>
+ <Reformat>true</Reformat>
+ </Language>
+ <Language id="yaml">
+ <Reformat>true</Reformat>
+ </Language>
+</profile></RIDER_SETTINGS></Profile>
+
+ True
+
+ EventStore
+ ExpressionBody
+ Implicit
+ Implicit
+ ExpressionBody
+ ExpressionBody
+ BaseClass
+ 0
+ 1
+ 0
+ Tab
+ False
+ True
+ False
+ False
+ True
+ END_OF_LINE
+ END_OF_LINE
+ True
+ False
+ True
+ True
+ True
+ False
+ True
+ True
+ END_OF_LINE
+ 1
+ 1
+ END_OF_LINE
+ TOGETHER
+ END_OF_LINE
+ True
+ True
+ True
+ True
+ True
+ False
+ True
+ True
+ True
+ True
+ True
+ END_OF_LINE
+ 1
+ 1
+ False
+ 6
+ 10
+ 6
+ 6
+ 10
+ EXPANDED
+ END_OF_LINE
+ True
+ True
+ True
+ IF_OWNER_IS_SINGLE_LINE
+ IF_OWNER_IS_SINGLE_LINE
+ True
+ END_OF_LINE
+ True
+ True
+ CHOP_IF_LONG
+ CHOP_IF_LONG
+ True
+ True
+ True
+ False
+ CHOP_IF_LONG
+ WRAP_IF_LONG
+ CHOP_IF_LONG
+ <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
+ <TypePattern DisplayName="Non-reorderable types">
+ <TypePattern.Match>
+ <Or>
+ <And>
+ <Kind Is="Interface" />
+ <Or>
+ <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
+ <HasAttribute Name="System.Runtime.InteropServices.ComImport" />
+ </Or>
+ </And>
+ <Kind Is="Struct" />
+ <HasAttribute Name="JetBrains.Annotations.NoReorderAttribute" />
+ <HasAttribute Name="JetBrains.Annotations.NoReorder" />
+ </Or>
+ </TypePattern.Match>
+ </TypePattern>
+
+ <TypePattern DisplayName="xUnit.net Test Classes" RemoveRegions="All">
+ <TypePattern.Match>
+ <And>
+ <Kind Is="Class" />
+ <HasMember>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="Xunit.FactAttribute" Inherited="True" />
+ <HasAttribute Name="Xunit.TheoryAttribute" Inherited="True" />
+ </And>
+ </HasMember>
+ </And>
+ </TypePattern.Match>
+
+ <Entry DisplayName="Setup/Teardown Methods">
+ <Entry.Match>
+ <Or>
+ <Kind Is="Constructor" />
+ <And>
+ <Kind Is="Method" />
+ <ImplementsInterface Name="System.IDisposable" />
+ </And>
+ </Or>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Kind>
+ <Kind.Order>
+ <DeclarationKind>Constructor</DeclarationKind>
+ </Kind.Order>
+ </Kind>
+ </Entry.SortBy>
+ </Entry>
+
+
+ <Entry DisplayName="All other members" />
+
+ <Entry DisplayName="Test Methods" Priority="100">
+ <Entry.Match>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="Xunit.FactAttribute" Inherited="false" />
+ <HasAttribute Name="Xunit.TheoryAttribute" Inherited="false" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+ </TypePattern>
+
+ <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All">
+ <TypePattern.Match>
+ <And>
+ <Kind Is="Class" />
+ <Or>
+ <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TestFixtureSourceAttribute" Inherited="true" />
+ <HasMember>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseSourceAttribute" Inherited="false" />
+ </And>
+ </HasMember>
+ </Or>
+ </And>
+ </TypePattern.Match>
+
+ <Entry DisplayName="Setup/Teardown Methods">
+ <Entry.Match>
+ <And>
+ <Kind Is="Method" />
+ <Or>
+ <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TestFixtureSetUpAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.TestFixtureTearDownAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.OneTimeSetUpAttribute" Inherited="true" />
+ <HasAttribute Name="NUnit.Framework.OneTimeTearDownAttribute" Inherited="true" />
+ </Or>
+ </And>
+ </Entry.Match>
+ </Entry>
+
+ <Entry DisplayName="All other members" />
+
+ <Entry DisplayName="Test Methods" Priority="100">
+ <Entry.Match>
+ <And>
+ <Kind Is="Method" />
+ <HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseAttribute" Inherited="false" />
+ <HasAttribute Name="NUnit.Framework.TestCaseSourceAttribute" Inherited="false" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+ </TypePattern>
+
+ <TypePattern DisplayName="Default Pattern">
+ <Entry DisplayName="Public Delegates" Priority="100">
+ <Entry.Match>
+ <And>
+ <Access Is="Public" />
+ <Kind Is="Delegate" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Public Enums" Priority="100">
+ <Entry.Match>
+ <And>
+ <Access Is="Public" />
+ <Kind Is="Enum" />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Constants" Priority="90">
+ <Entry.Match>
+ <Kind Is="Constant" />
+ </Entry.Match>
+ </Entry>
+
+ <Entry DisplayName="Static Fields" Priority="85">
+ <Entry.Match>
+ <And>
+ <Kind Is="Field" />
+ <Static />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Readonly />
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Fields">
+ <Entry.Match>
+ <And>
+ <Kind Is="Field" />
+ <Not>
+ <Static />
+ </Not>
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Readonly />
+ <Name />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Constructors">
+ <Entry.Match>
+ <Kind Is="Constructor" />
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <Static/>
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="Properties, Indexers">
+ <Entry.Match>
+ <Or>
+ <Kind Is="Property" />
+ <Kind Is="Indexer" />
+ </Or>
+ </Entry.Match>
+ </Entry>
+
+ <Entry DisplayName="Interface Implementations" Priority="100">
+ <Entry.Match>
+ <And>
+ <Kind Is="Member" />
+ <ImplementsInterface />
+ </And>
+ </Entry.Match>
+
+ <Entry.SortBy>
+ <ImplementsInterface Immediate="true" />
+ </Entry.SortBy>
+ </Entry>
+
+ <Entry DisplayName="All other members" />
+
+ <Entry DisplayName="Nested Types">
+ <Entry.Match>
+ <Kind Is="Type" />
+ </Entry.Match>
+ </Entry>
+ </TypePattern>
+</Patterns>
+
+ True
+ False
+
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
\ No newline at end of file
diff --git a/samples/appending-events/appending-events.csproj b/samples/appending-events/appending-events.csproj
index 6568339cc..34b8399e9 100644
--- a/samples/appending-events/appending-events.csproj
+++ b/samples/appending-events/appending-events.csproj
@@ -1,15 +1,13 @@
-
Exe
appending_events
-
-
-
-
+
+
+
+
-
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 2906126b9..1d8ff5b7d 100644
--- a/samples/connecting-to-a-cluster/connecting-to-a-cluster.csproj
+++ b/samples/connecting-to-a-cluster/connecting-to-a-cluster.csproj
@@ -1,15 +1,13 @@
+
+ Exe
+ connecting_to_a_cluster
+
-
- Exe
- connecting_to_a_cluster
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
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 0d884a279..337b66b85 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
@@ -1,14 +1,12 @@
+
+ Exe
+
-
- Exe
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/samples/persistent-subscriptions/persistent-subscriptions.csproj b/samples/persistent-subscriptions/persistent-subscriptions.csproj
index 8fbad84e3..e845bda8e 100644
--- a/samples/persistent-subscriptions/persistent-subscriptions.csproj
+++ b/samples/persistent-subscriptions/persistent-subscriptions.csproj
@@ -1,14 +1,12 @@
-
Exe
persistent_subscriptions
-
-
-
+
+
+
-
diff --git a/samples/projection-management/projection-management.csproj b/samples/projection-management/projection-management.csproj
index a9528b37c..3b5b2c3c7 100644
--- a/samples/projection-management/projection-management.csproj
+++ b/samples/projection-management/projection-management.csproj
@@ -1,12 +1,10 @@
+
+ projection_management
+
-
- projection_management
-
-
-
-
-
-
-
+
+
+
+
diff --git a/samples/quick-start/quick-start.csproj b/samples/quick-start/quick-start.csproj
index 42ec5bf0b..9921046d6 100644
--- a/samples/quick-start/quick-start.csproj
+++ b/samples/quick-start/quick-start.csproj
@@ -1,14 +1,12 @@
+
+ quick_start
+
-
- quick_start
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/samples/reading-events/reading-events.csproj b/samples/reading-events/reading-events.csproj
index 5113edb01..0ae95a9a5 100644
--- a/samples/reading-events/reading-events.csproj
+++ b/samples/reading-events/reading-events.csproj
@@ -1,13 +1,11 @@
-
reading_events
-
-
-
+
+
+
-
-
+
\ 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 c8ed090c8..149de2f9b 100644
--- a/samples/secure-with-tls/secure-with-tls.csproj
+++ b/samples/secure-with-tls/secure-with-tls.csproj
@@ -1,12 +1,11 @@
-
secure_with_tls
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/samples/server-side-filtering/server-side-filtering.csproj b/samples/server-side-filtering/server-side-filtering.csproj
index 8b97ad502..34b2d4c39 100644
--- a/samples/server-side-filtering/server-side-filtering.csproj
+++ b/samples/server-side-filtering/server-side-filtering.csproj
@@ -5,10 +5,10 @@
-
-
-
-
+
+
+
+
-
+
\ 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 9c5f54c2a..7f3b511bd 100644
--- a/samples/setting-up-dependency-injection/setting-up-dependency-injection.csproj
+++ b/samples/setting-up-dependency-injection/setting-up-dependency-injection.csproj
@@ -1,14 +1,12 @@
+
+ setting_up_dependency_injection
+
-
- setting_up_dependency_injection
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/subscribing-to-streams/subscribing-to-streams.csproj b/samples/subscribing-to-streams/subscribing-to-streams.csproj
index b2de653f2..d67c0a569 100644
--- a/samples/subscribing-to-streams/subscribing-to-streams.csproj
+++ b/samples/subscribing-to-streams/subscribing-to-streams.csproj
@@ -1,14 +1,12 @@
-
subscribing_to_streams
-
-
-
-
+
+
+
+
-
-
+
\ No newline at end of file
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 1844c3399..1921131a9 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,52 +1,64 @@
-
-
- $(MSBuildProjectName.Remove(0,18))
- $(ESPackageIdSuffix.ToLower()).proto
- ../EventStore.Client.Common/protos/$(ESProto)
- EventStore.Client.Grpc.$(ESPackageIdSuffix)
-
-
-
-
-
-
- ouro.png
- LICENSE.md
- https://eventstore.com
- false
- https://eventstore.com/blog/
- eventstore client grpc
- Event Store Ltd
- Copyright 2012-2020 Event Store Ltd
- v
- true
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
- all
- runtime; build; native; contentfiles; analyzers
-
-
-
-
-
-
-
-
- <_Parameter1>$(ProjectName).Tests
-
-
+
+
+ EventStore.Client
+
+
+
+ $(MSBuildProjectName.Remove(0,18))
+ $(ESPackageIdSuffix.ToLower()).proto
+ ../EventStore.Client.Common/protos/$(ESProto)
+ EventStore.Client.Grpc.$(ESPackageIdSuffix)
+
+
+
+
+
+
+
+
+ ouro.png
+ LICENSE.md
+ https://eventstore.com
+ false
+ https://eventstore.com/blog/
+ eventstore client grpc
+ Event Store Ltd
+ Copyright 2012-2020 Event Store Ltd
+ v
+ true
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
+
+
+
+
+
+
+
+
+ <_Parameter1>$(ProjectName).Tests
+
+
+ <_Parameter1>$(ProjectName).Tests.Common
+
+
+ <_Parameter1>EventStore.Client
+
+
diff --git a/src/EventStore.Client.Common/AsyncStreamReaderExtensions.cs b/src/EventStore.Client.Common/AsyncStreamReaderExtensions.cs
index fe2d553bc..5ad598e4a 100644
--- a/src/EventStore.Client.Common/AsyncStreamReaderExtensions.cs
+++ b/src/EventStore.Client.Common/AsyncStreamReaderExtensions.cs
@@ -1,14 +1,15 @@
-using System.Collections.Generic;
using System.Runtime.CompilerServices;
-using System.Threading;
using Grpc.Core;
-namespace EventStore.Client {
- internal 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;
- }
- }
+
+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;
}
-}
+}
\ No newline at end of file
diff --git a/src/EventStore.Client.Common/Constants.cs b/src/EventStore.Client.Common/Constants.cs
index 1e4c317e6..3e0279e6b 100644
--- a/src/EventStore.Client.Common/Constants.cs
+++ b/src/EventStore.Client.Common/Constants.cs
@@ -1,61 +1,61 @@
-namespace EventStore.Client {
- internal 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";
- }
+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 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 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 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";
- }
+ public const string ConnectionName = "connection-name";
+ public const string RequiresLeader = "requires-leader";
}
-}
+}
\ No newline at end of file
diff --git a/src/EventStore.Client.Common/EpochExtensions.cs b/src/EventStore.Client.Common/EpochExtensions.cs
index 5a9875153..d62bdb44c 100644
--- a/src/EventStore.Client.Common/EpochExtensions.cs
+++ b/src/EventStore.Client.Common/EpochExtensions.cs
@@ -1,13 +1,9 @@
-using System;
+namespace EventStore.Client;
-namespace EventStore.Client {
- internal static class EpochExtensions {
- private static readonly DateTime UnixEpoch = DateTime.UnixEpoch;
+static class EpochExtensions {
+ static readonly DateTime UnixEpoch = DateTime.UnixEpoch;
- public static DateTime FromTicksSinceEpoch(this long value) =>
- new DateTime(UnixEpoch.Ticks + value, DateTimeKind.Utc);
+ public static DateTime FromTicksSinceEpoch(this long value) => new(UnixEpoch.Ticks + value, DateTimeKind.Utc);
- public static long ToTicksSinceEpoch(this DateTime value) =>
- (value - UnixEpoch).Ticks;
- }
-}
+ public static long ToTicksSinceEpoch(this DateTime value) => (value - UnixEpoch).Ticks;
+}
\ No newline at end of file
diff --git a/src/EventStore.Client.Common/EventStoreCallOptions.cs b/src/EventStore.Client.Common/EventStoreCallOptions.cs
index 01ebda16f..e6058a170 100644
--- a/src/EventStore.Client.Common/EventStoreCallOptions.cs
+++ b/src/EventStore.Client.Common/EventStoreCallOptions.cs
@@ -1,30 +1,48 @@
-using System;
-using System.Threading;
using Grpc.Core;
-using Timeout_ = System.Threading.Timeout;
-
-namespace EventStore.Client {
- internal 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);
-
- private static CallOptions Create(EventStoreClientSettings settings, TimeSpan? deadline,
- UserCredentials? userCredentials, CancellationToken cancellationToken) => new(
+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 Metadata {
+ headers: new() {
{
Constants.Headers.RequiresLeader,
settings.ConnectivitySettings.NodePreference == NodePreference.Leader
@@ -34,20 +52,23 @@ private static CallOptions Create(EventStoreClientSettings settings, TimeSpan? d
},
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);
- })
+ : 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);
+ }
+ )
);
- private static DateTime? DeadlineAfter(TimeSpan? timeoutAfter) => !timeoutAfter.HasValue
+ static DateTime? DeadlineAfter(TimeSpan? timeoutAfter) =>
+ !timeoutAfter.HasValue
? new DateTime?()
- : timeoutAfter.Value == TimeSpan.MaxValue || timeoutAfter.Value == Timeout_.InfiniteTimeSpan
+ : 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.Common/MetadataExtensions.cs b/src/EventStore.Client.Common/MetadataExtensions.cs
index 21883506b..e547970fd 100644
--- a/src/EventStore.Client.Common/MetadataExtensions.cs
+++ b/src/EventStore.Client.Common/MetadataExtensions.cs
@@ -1,29 +1,29 @@
using Grpc.Core;
-namespace EventStore.Client {
- internal static class MetadataExtensions {
- public static bool TryGetValue(this Metadata metadata, string key, out string? value) {
- value = default;
+namespace EventStore.Client;
- foreach (var entry in metadata) {
- if (entry.Key != key) {
- continue;
- }
- value = entry.Value;
- return true;
- }
+static class MetadataExtensions {
+ public static bool TryGetValue(this Metadata metadata, string key, out string? value) {
+ value = default;
- return false;
- }
+ foreach (var entry in metadata) {
+ if (entry.Key != key)
+ continue;
- public static StreamRevision GetStreamRevision(this Metadata metadata, string key)
- => metadata.TryGetValue(key, out var s) && ulong.TryParse(s, out var value)
- ? new StreamRevision(value)
- : StreamRevision.None;
+ value = entry.Value;
+ return true;
+ }
- public static int GetIntValueOrDefault(this Metadata metadata, string key)
- => metadata.TryGetValue(key, out var s) && int.TryParse(s, out var value)
- ? value
- : default;
+ 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.ProjectionManagement/EventStoreProjectionManagementClient.State.cs b/src/EventStore.Client.ProjectionManagement/EventStoreProjectionManagementClient.State.cs
index f1c462fcd..ec23295a5 100644
--- a/src/EventStore.Client.ProjectionManagement/EventStoreProjectionManagementClient.State.cs
+++ b/src/EventStore.Client.ProjectionManagement/EventStoreProjectionManagementClient.State.cs
@@ -9,6 +9,8 @@
namespace EventStore.Client {
public partial class EventStoreProjectionManagementClient {
+ static readonly JsonSerializerOptions DefaultJsonSerializerOptions = new JsonSerializerOptions();
+
///
/// Gets the result of a projection as an untyped document.
///
@@ -27,7 +29,7 @@ public async Task GetResultAsync(string name, string? partition =
await using var stream = new MemoryStream();
await using var writer = new Utf8JsonWriter(stream);
var serializer = new ValueSerializer();
- serializer.Write(writer, value, new JsonSerializerOptions());
+ serializer.Write(writer, value, DefaultJsonSerializerOptions);
await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
stream.Position = 0;
@@ -54,7 +56,7 @@ public async Task GetResultAsync(string name, string? partition = null,
await using var stream = new MemoryStream();
await using var writer = new Utf8JsonWriter(stream);
var serializer = new ValueSerializer();
- serializer.Write(writer, value, new JsonSerializerOptions());
+ serializer.Write(writer, value, DefaultJsonSerializerOptions);
await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
stream.Position = 0;
@@ -94,7 +96,7 @@ public async Task GetStateAsync(string name, string? partition = n
await using var stream = new MemoryStream();
await using var writer = new Utf8JsonWriter(stream);
var serializer = new ValueSerializer();
- serializer.Write(writer, value, new JsonSerializerOptions());
+ serializer.Write(writer, value, DefaultJsonSerializerOptions);
stream.Position = 0;
await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
@@ -121,7 +123,7 @@ public async Task GetStateAsync(string name, string? partition = null,
await using var stream = new MemoryStream();
await using var writer = new Utf8JsonWriter(stream);
var serializer = new ValueSerializer();
- serializer.Write(writer, value, new JsonSerializerOptions());
+ serializer.Write(writer, value, DefaultJsonSerializerOptions);
await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
stream.Position = 0;
diff --git a/src/EventStore.Client.Streams/InvalidTransactionException.cs b/src/EventStore.Client.Streams/InvalidTransactionException.cs
index 1cf590a79..17933b654 100644
--- a/src/EventStore.Client.Streams/InvalidTransactionException.cs
+++ b/src/EventStore.Client.Streams/InvalidTransactionException.cs
@@ -1,34 +1,31 @@
using System;
using System.Runtime.Serialization;
-namespace EventStore.Client {
- ///
- /// Exception thrown if there is an attempt to operate inside a
- /// transaction which does not exist.
- ///
- public class InvalidTransactionException : Exception {
- ///
- /// Constructs a new .
- ///
- public InvalidTransactionException() {
- }
+namespace EventStore.Client;
- ///
- /// Constructs a new .
- ///
- public InvalidTransactionException(string message) : base(message) {
- }
+///
+/// Exception thrown if there is an attempt to operate inside a
+/// transaction which does not exist.
+///
+public class InvalidTransactionException : Exception {
+ ///
+ /// Constructs a new .
+ ///
+ public InvalidTransactionException() { }
- ///
- /// Constructs a new .
- ///
- public InvalidTransactionException(string message, Exception innerException) : base(message, innerException) {
- }
+ ///
+ /// Constructs a new .
+ ///
+ public InvalidTransactionException(string message) : base(message) { }
- ///
- /// Constructs a new .
- ///
- protected InvalidTransactionException(SerializationInfo info, StreamingContext context) : base(info, context) {
- }
- }
-}
+ ///
+ /// Constructs a new .
+ ///
+ public InvalidTransactionException(string message, Exception innerException) : base(message, innerException) { }
+
+ ///
+ /// Constructs a new .
+ ///
+ [Obsolete("Obsolete")]
+ protected InvalidTransactionException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+}
\ No newline at end of file
diff --git a/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj b/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj
index 5d173ebc7..68b8d5098 100644
--- a/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj
+++ b/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj
@@ -3,4 +3,7 @@
The GRPC client API for managing users in Event Store. Get the open source or commercial versions of Event Store server from https://eventstore.com/
+
+
+
diff --git a/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj.DotSettings b/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj.DotSettings
new file mode 100644
index 000000000..1183b3a73
--- /dev/null
+++ b/src/EventStore.Client.UserManagement/EventStore.Client.UserManagement.csproj.DotSettings
@@ -0,0 +1,2 @@
+
+ True
\ No newline at end of file
diff --git a/src/EventStore.Client.UserManagement/EventStoreUserManagementClient.cs b/src/EventStore.Client.UserManagement/EventStoreUserManagementClient.cs
index 2fb533cb6..a0680cbf6 100644
--- a/src/EventStore.Client.UserManagement/EventStoreUserManagementClient.cs
+++ b/src/EventStore.Client.UserManagement/EventStoreUserManagementClient.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Runtime.CompilerServices;
-using System.Threading;
-using System.Threading.Tasks;
using EventStore.Client.Users;
using Grpc.Core;
using Microsoft.Extensions.Logging;
diff --git a/src/EventStore.Client.UserManagement/EventStoreUserManagementClientCollectionExtensions.cs b/src/EventStore.Client.UserManagement/EventStoreUserManagementClientCollectionExtensions.cs
index 2907a7a28..539f5849f 100644
--- a/src/EventStore.Client.UserManagement/EventStoreUserManagementClientCollectionExtensions.cs
+++ b/src/EventStore.Client.UserManagement/EventStoreUserManagementClientCollectionExtensions.cs
@@ -1,7 +1,5 @@
// ReSharper disable CheckNamespace
-using System;
-using System.Net.Http;
using EventStore.Client;
using Grpc.Core.Interceptors;
using Microsoft.Extensions.DependencyInjection.Extensions;
diff --git a/src/EventStore.Client.UserManagement/EventStoreUserManagerClientExtensions.cs b/src/EventStore.Client.UserManagement/EventStoreUserManagerClientExtensions.cs
index 3b854ccf4..a43ae43d7 100644
--- a/src/EventStore.Client.UserManagement/EventStoreUserManagerClientExtensions.cs
+++ b/src/EventStore.Client.UserManagement/EventStoreUserManagerClientExtensions.cs
@@ -1,22 +1,23 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
+namespace EventStore.Client;
-namespace EventStore.Client {
- ///
- /// A set of extension methods for an .
- ///
- public static class EventStoreUserManagerClientExtensions {
- ///
- /// Gets the of the internal user specified by the supplied .
- ///
- ///
- ///
- ///
- ///
- ///
- public static Task GetCurrentUserAsync(this EventStoreUserManagementClient users,
- UserCredentials userCredentials, TimeSpan? deadline = null, CancellationToken cancellationToken = default)
- => users.GetUserAsync(userCredentials.Username!, deadline, userCredentials, cancellationToken);
- }
-}
+///
+/// A set of extension methods for an .
+///
+public static class EventStoreUserManagerClientExtensions {
+ ///
+ /// Gets the of the internal user specified by the supplied .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Task GetCurrentUserAsync(
+ this EventStoreUserManagementClient users,
+ UserCredentials userCredentials, TimeSpan? deadline = null, CancellationToken cancellationToken = default
+ ) =>
+ users.GetUserAsync(
+ userCredentials.Username!, deadline, userCredentials,
+ cancellationToken
+ );
+}
\ No newline at end of file
diff --git a/src/EventStore.Client.UserManagement/UserDetails.cs b/src/EventStore.Client.UserManagement/UserDetails.cs
index 337d93a67..92c345eea 100644
--- a/src/EventStore.Client.UserManagement/UserDetails.cs
+++ b/src/EventStore.Client.UserManagement/UserDetails.cs
@@ -1,100 +1,97 @@
-using System;
-using System.Linq;
+namespace EventStore.Client;
-namespace EventStore.Client {
- ///
- /// Provides the details for a user.
- ///
- public readonly struct UserDetails : IEquatable {
- ///
- /// The users login name.
- ///
- public readonly string LoginName;
+///
+/// Provides the details for a user.
+///
+public readonly struct UserDetails : IEquatable {
+ ///
+ /// The users login name.
+ ///
+ public readonly string LoginName;
- ///
- /// The full name of the user.
- ///
- public readonly string FullName;
+ ///
+ /// The full name of the user.
+ ///
+ public readonly string FullName;
- ///
- /// The groups the user is a member of.
- ///
- public readonly string[] Groups;
+ ///
+ /// The groups the user is a member of.
+ ///
+ public readonly string[] Groups;
- ///
- /// The date/time the user was updated in UTC format.
- ///
- public readonly DateTimeOffset? DateLastUpdated;
+ ///
+ /// The date/time the user was updated in UTC format.
+ ///
+ public readonly DateTimeOffset? DateLastUpdated;
- ///
- /// Whether the user disable or not.
- ///
- public readonly bool Disabled;
+ ///
+ /// Whether the user disable or not.
+ ///
+ public readonly bool Disabled;
- ///
- /// create a new class.
- ///
- /// The login name of the user.
- /// The users full name.
- /// The groups this user is a member if.
- /// Is this user disabled or not.
- /// The datt/time this user was last updated in UTC format.
- public UserDetails(
- string loginName, string fullName, string[] groups, bool disabled, DateTimeOffset? dateLastUpdated) {
- if (loginName == null) {
- throw new ArgumentNullException(nameof(loginName));
- }
+ ///
+ /// create a new class.
+ ///
+ /// The login name of the user.
+ /// The users full name.
+ /// The groups this user is a member if.
+ /// Is this user disabled or not.
+ /// The datt/time this user was last updated in UTC format.
+ public UserDetails(
+ string loginName, string fullName, string[] groups, bool disabled, DateTimeOffset? dateLastUpdated) {
+ if (loginName == null) {
+ throw new ArgumentNullException(nameof(loginName));
+ }
- if (fullName == null) {
- throw new ArgumentNullException(nameof(fullName));
- }
+ if (fullName == null) {
+ throw new ArgumentNullException(nameof(fullName));
+ }
- if (groups == null) {
- throw new ArgumentNullException(nameof(groups));
- }
+ if (groups == null) {
+ throw new ArgumentNullException(nameof(groups));
+ }
- LoginName = loginName;
- FullName = fullName;
- Groups = groups;
- Disabled = disabled;
- DateLastUpdated = dateLastUpdated;
- }
+ LoginName = loginName;
+ FullName = fullName;
+ Groups = groups;
+ Disabled = disabled;
+ DateLastUpdated = dateLastUpdated;
+ }
- ///
- public bool Equals(UserDetails other) =>
- LoginName == other.LoginName && FullName == other.FullName && Groups.SequenceEqual(other.Groups) &&
- Nullable.Equals(DateLastUpdated, other.DateLastUpdated) && Disabled == other.Disabled;
+ ///
+ public bool Equals(UserDetails other) =>
+ LoginName == other.LoginName && FullName == other.FullName && Groups.SequenceEqual(other.Groups) &&
+ Nullable.Equals(DateLastUpdated, other.DateLastUpdated) && Disabled == other.Disabled;
- ///
- public override bool Equals(object? obj) => obj is UserDetails other && Equals(other);
+ ///
+ public override bool Equals(object? obj) => obj is UserDetails other && Equals(other);
- ///
- public override int GetHashCode() => HashCode.Hash.Combine(LoginName).Combine(FullName).Combine(Groups)
- .Combine(Disabled).Combine(DateLastUpdated);
+ ///
+ public override int GetHashCode() => HashCode.Hash.Combine(LoginName).Combine(FullName).Combine(Groups)
+ .Combine(Disabled).Combine(DateLastUpdated);
- ///
- /// Compares left and right for equality.
- ///
- ///
- ///
- /// True if left is equal to right.
- public static bool operator ==(UserDetails left, UserDetails right) => left.Equals(right);
+ ///
+ /// Compares left and right for equality.
+ ///
+ ///
+ ///
+ /// True if left is equal to right.
+ public static bool operator ==(UserDetails left, UserDetails right) => left.Equals(right);
- ///
- /// Compares left and right for inequality.
- ///
- ///
- ///
- /// True if left is not equal to right.
- public static bool operator !=(UserDetails left, UserDetails right) => !left.Equals(right);
+ ///
+ /// Compares left and right for inequality.
+ ///
+ ///
+ ///
+ /// True if left is not equal to right.
+ public static bool operator !=(UserDetails left, UserDetails right) => !left.Equals(right);
- ///
- public override string ToString() =>
- new {
- Disabled,
- FullName,
- LoginName,
- Groups = string.Join(",", Groups)
- }?.ToString()!;
- }
-}
+ ///
+ public override string ToString() =>
+ new {
+ Disabled,
+ FullName,
+ LoginName,
+ Groups = string.Join(",", Groups)
+ }?.ToString()!;
+}
\ No newline at end of file
diff --git a/src/EventStore.Client/ChannelCache.cs b/src/EventStore.Client/ChannelCache.cs
index cbf78b730..1ed172bc6 100644
--- a/src/EventStore.Client/ChannelCache.cs
+++ b/src/EventStore.Client/ChannelCache.cs
@@ -33,7 +33,7 @@ public TChannel GetChannelInfo(DnsEndPoint endPoint) {
if (!_channels.TryGetValue(endPoint, out var channel)) {
channel = ChannelFactory.CreateChannel(
- settings: _settings,
+ settings: _settings,
endPoint: endPoint);
_channels[endPoint] = channel;
}
diff --git a/src/EventStore.Client/EventStore.Client.csproj b/src/EventStore.Client/EventStore.Client.csproj
index 32db2e4d7..ca10005c9 100644
--- a/src/EventStore.Client/EventStore.Client.csproj
+++ b/src/EventStore.Client/EventStore.Client.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/src/EventStore.Client/EventStoreClientBase.cs b/src/EventStore.Client/EventStoreClientBase.cs
index 195a5db51..d3252a330 100644
--- a/src/EventStore.Client/EventStoreClientBase.cs
+++ b/src/EventStore.Client/EventStoreClientBase.cs
@@ -82,14 +82,16 @@ private async Task GetChannelInfoExpensive(
/// Gets the current channel info.
protected async ValueTask GetChannelInfo(CancellationToken cancellationToken) =>
await _channelInfoProvider.CurrentAsync.WithCancellation(cancellationToken).ConfigureAwait(false);
-
- // only exists so that we can manually trigger rediscovery in the tests (by reflection)
- // in cases where the server doesn't yet let the client know that it needs to.
- // see EventStoreClientExtensions.WarmUpWith.
- // note if rediscovery is already in progress it will continue, not restart.
- // ReSharper disable once UnusedMember.Local
- private void Rediscover() {
+
+
+ ///
+ /// Only exists so that we can manually trigger rediscovery in the tests
+ /// in cases where the server doesn't yet let the client know that it needs to.
+ /// note if rediscovery is already in progress it will continue, not restart.
+ ///
+ internal Task RediscoverAsync() {
_channelInfoProvider.Reset();
+ return Task.CompletedTask;
}
/// Returns the result of an HTTP Get request based on the client settings.
diff --git a/src/EventStore.Client/UserCredentials.cs b/src/EventStore.Client/UserCredentials.cs
index e949016f5..d944d90d7 100644
--- a/src/EventStore.Client/UserCredentials.cs
+++ b/src/EventStore.Client/UserCredentials.cs
@@ -1,6 +1,6 @@
-using System;
using System.Net.Http.Headers;
using System.Text;
+using static System.Convert;
namespace EventStore.Client {
///
@@ -8,58 +8,47 @@ namespace EventStore.Client {
/// authorization to perform operations on the EventStoreDB.
///
public class UserCredentials {
- ///
- /// The username
- ///
- public string? Username => TryGetBasicAuth(0, out var value) ? value : null;
- ///
- /// The password
- ///
- public string? Password => TryGetBasicAuth(1, out var value) ? value : null;
-
- private readonly AuthenticationHeaderValue _authorization;
+ // ReSharper disable once InconsistentNaming
+ static readonly UTF8Encoding UTF8NoBom = new UTF8Encoding(false);
///
/// Constructs a new .
///
- ///
- ///
- public UserCredentials(string username, string password) : this(new AuthenticationHeaderValue(
- Constants.Headers.BasicScheme,
- Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")))) {
+ public UserCredentials(string username, string password) {
+ Username = username;
+ Password = password;
+
+ Authorization = new(
+ Constants.Headers.BasicScheme,
+ ToBase64String(UTF8NoBom.GetBytes($"{username}:{password}"))
+ );
}
///
/// Constructs a new .
///
- ///
- public UserCredentials(string authToken) : this(new AuthenticationHeaderValue(Constants.Headers.BearerScheme,
- authToken)) {
+ public UserCredentials(string bearerToken) {
+ Authorization = new(Constants.Headers.BearerScheme, bearerToken);
}
- private UserCredentials(AuthenticationHeaderValue authorization) => _authorization = authorization;
-
- private bool TryGetBasicAuth(int index, out string? value) {
- value = null;
-
- if (_authorization.Scheme != Constants.Headers.BasicScheme) {
- return false;
- }
-
- if (_authorization.Parameter == null) {
- return false;
- }
+ AuthenticationHeaderValue Authorization { get; }
- var parts = Encoding.ASCII.GetString(Convert.FromBase64String(_authorization.Parameter)).Split(':');
- if (parts.Length <= index) {
- return false;
- }
+ ///
+ /// The username
+ ///
+ public string? Username { get; }
- value = parts[index];
- return true;
- }
+ ///
+ /// The password
+ ///
+ public string? Password { get; }
///
- public override string ToString() => _authorization.ToString();
+ public override string ToString() => Authorization.ToString();
+
+ ///
+ /// Implicitly convert a to a .
+ ///
+ public static implicit operator string(UserCredentials self) => self.ToString();
}
-}
+}
\ No newline at end of file
diff --git a/test/Directory.Build.props b/test/Directory.Build.props
index 6c176dac1..213f077ff 100644
--- a/test/Directory.Build.props
+++ b/test/Directory.Build.props
@@ -1,39 +1,31 @@
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ true
+ xUnit1031
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/EventStore.Client.Tests.Common/AssemblyInfo.cs b/test/EventStore.Client.Operations.Tests/AssemblyInfo.cs
similarity index 80%
rename from test/EventStore.Client.Tests.Common/AssemblyInfo.cs
rename to test/EventStore.Client.Operations.Tests/AssemblyInfo.cs
index 217120083..b0b47aa73 100644
--- a/test/EventStore.Client.Tests.Common/AssemblyInfo.cs
+++ b/test/EventStore.Client.Operations.Tests/AssemblyInfo.cs
@@ -1,3 +1 @@
-using Xunit;
-
-[assembly: CollectionBehavior(DisableTestParallelization = true)]
+[assembly: CollectionBehavior(DisableTestParallelization = true)]
\ No newline at end of file
diff --git a/test/EventStore.Client.Operations.Tests/AuthenticationTests.cs b/test/EventStore.Client.Operations.Tests/AuthenticationTests.cs
index e72301f60..084a92989 100644
--- a/test/EventStore.Client.Operations.Tests/AuthenticationTests.cs
+++ b/test/EventStore.Client.Operations.Tests/AuthenticationTests.cs
@@ -1,78 +1,67 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Xunit;
+namespace EventStore.Client.Operations.Tests;
-namespace EventStore.Client {
- public class AuthenticationTests : IClassFixture {
- private readonly Fixture _fixture;
- private static readonly Dictionary _credentials =
- new Dictionary {
- { nameof(TestCredentials.Root), TestCredentials.Root },
- { nameof(TestCredentials.TestUser1), TestCredentials.TestUser1 },
- };
+public class AuthenticationTests : IClassFixture {
+ public AuthenticationTests(ITestOutputHelper output, InsecureClientTestFixture fixture) => Fixture = fixture.With(x => x.CaptureTestRun(output));
- public AuthenticationTests(Fixture fixture) {
- _fixture = fixture;
- }
+ InsecureClientTestFixture Fixture { get; }
+
+ public enum CredentialsCase { None, TestUser, RootUser }
- public static IEnumerable