diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9a41ec17..c87d58d8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,15 +21,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- - name: Start Redis
- uses: supercharge/redis-github-action@1.2.0
- with:
- redis-version: 7.0.2
- - name: Start MongoDB
- uses: supercharge/mongodb-github-action@1.7.0
- with:
- mongodb-version: 5.0.9
- mongodb-replica-set: entitydb
- name: Install .NET SDK
uses: actions/setup-dotnet@v2
- name: Restore Dependencies
diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml
index feaf9369..a79a0b36 100644
--- a/.github/workflows/publish-beta.yml
+++ b/.github/workflows/publish-beta.yml
@@ -37,15 +37,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- - name: Start Redis
- uses: supercharge/redis-github-action@1.2.0
- with:
- redis-version: 7.0.2
- - name: Start MongoDB
- uses: supercharge/mongodb-github-action@1.7.0
- with:
- mongodb-version: 5.0.9
- mongodb-replica-set: entitydb
- name: Install .NET SDK
uses: actions/setup-dotnet@v2
- name: Restore Dependencies
diff --git a/.github/workflows/publish-stable.yml b/.github/workflows/publish-stable.yml
index e60153af..15fe4284 100644
--- a/.github/workflows/publish-stable.yml
+++ b/.github/workflows/publish-stable.yml
@@ -45,15 +45,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- - name: Start Redis
- uses: supercharge/redis-github-action@1.2.0
- with:
- redis-version: 7.0.2
- - name: Start MongoDB
- uses: supercharge/mongodb-github-action@1.7.0
- with:
- mongodb-version: 5.0.9
- mongodb-replica-set: entitydb
- name: Install .NET SDK
uses: actions/setup-dotnet@v2
- name: Restore Dependencies
diff --git a/Directory.Build.props b/Directory.Build.props
index e1913bdd..026d3c98 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -5,5 +5,10 @@
10.0
enable
True
+ enable
+
+
+
+
\ No newline at end of file
diff --git a/EntityDb.sln b/EntityDb.sln
index 4ff658ab..317a0623 100644
--- a/EntityDb.sln
+++ b/EntityDb.sln
@@ -25,7 +25,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{92484C44-2754-4C1D-BD46-98D83E4020EE}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
- test\docker-compose.yml = test\docker-compose.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Common.Tests", "test\EntityDb.Common.Tests\EntityDb.Common.Tests.csproj", "{CF316519-525E-4A67-BF12-1FDDF802B878}"
@@ -42,7 +41,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityDb.InMemory", "src\EntityDb.InMemory\EntityDb.InMemory.csproj", "{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.InMemory", "src\EntityDb.InMemory\EntityDb.InMemory.csproj", "{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Npgsql", "src\EntityDb.Npgsql\EntityDb.Npgsql.csproj", "{2AADF21D-4F26-4BD6-852A-B28208863FDD}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Npgsql.Provisioner", "src\EntityDb.Npgsql.Provisioner\EntityDb.Npgsql.Provisioner.csproj", "{282DFD9B-14E4-4339-B55A-3567E128FF1B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.SqlDb", "src\EntityDb.SqlDb\EntityDb.SqlDb.csproj", "{F2491666-31D1-47B5-A493-F25E167D1FDF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Json", "src\EntityDb.Json\EntityDb.Json.csproj", "{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -98,6 +105,22 @@ Global
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2AADF21D-4F26-4BD6-852A-B28208863FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2AADF21D-4F26-4BD6-852A-B28208863FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2AADF21D-4F26-4BD6-852A-B28208863FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2AADF21D-4F26-4BD6-852A-B28208863FDD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {282DFD9B-14E4-4339-B55A-3567E128FF1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {282DFD9B-14E4-4339-B55A-3567E128FF1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {282DFD9B-14E4-4339-B55A-3567E128FF1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {282DFD9B-14E4-4339-B55A-3567E128FF1B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F2491666-31D1-47B5-A493-F25E167D1FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F2491666-31D1-47B5-A493-F25E167D1FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F2491666-31D1-47B5-A493-F25E167D1FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F2491666-31D1-47B5-A493-F25E167D1FDF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -115,6 +138,10 @@ Global
{B8B6E5A5-5154-4629-9A38-9F0E65575F30} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{FA2AD2E9-84DA-4667-BF46-140B0B050563} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
+ {2AADF21D-4F26-4BD6-852A-B28208863FDD} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
+ {282DFD9B-14E4-4339-B55A-3567E128FF1B} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
+ {F2491666-31D1-47B5-A493-F25E167D1FDF} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
+ {4936FFE0-98E5-43A2-89C9-0415A13CAA9B} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E9D288EE-9351-4018-ABE8-B0968AEB0465}
diff --git a/src/EntityDb.Abstractions/Agents/IAgentAccessor.cs b/src/EntityDb.Abstractions/Agents/IAgentAccessor.cs
index 3aa1cc3c..a0bf7fbf 100644
--- a/src/EntityDb.Abstractions/Agents/IAgentAccessor.cs
+++ b/src/EntityDb.Abstractions/Agents/IAgentAccessor.cs
@@ -1,7 +1,4 @@
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace EntityDb.Abstractions.Agents;
+namespace EntityDb.Abstractions.Agents;
///
/// Represents a type that can access an instance of .
diff --git a/src/EntityDb.Abstractions/Agents/IAgentSignatureAugmenter.cs b/src/EntityDb.Abstractions/Agents/IAgentSignatureAugmenter.cs
index 976b2b86..3c3ff651 100644
--- a/src/EntityDb.Abstractions/Agents/IAgentSignatureAugmenter.cs
+++ b/src/EntityDb.Abstractions/Agents/IAgentSignatureAugmenter.cs
@@ -1,7 +1,3 @@
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
namespace EntityDb.Abstractions.Agents;
///
diff --git a/src/EntityDb.Abstractions/Disposables/IDisposableResource.cs b/src/EntityDb.Abstractions/Disposables/IDisposableResource.cs
index 6ac72b6a..d5862de8 100644
--- a/src/EntityDb.Abstractions/Disposables/IDisposableResource.cs
+++ b/src/EntityDb.Abstractions/Disposables/IDisposableResource.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace EntityDb.Abstractions.Disposables;
+namespace EntityDb.Abstractions.Disposables;
///
/// Marks a resource as disposable and provides a default implementation.
diff --git a/src/EntityDb.Abstractions/Entities/IEntityRepository.cs b/src/EntityDb.Abstractions/Entities/IEntityRepository.cs
index 65b774a4..1af25d9b 100644
--- a/src/EntityDb.Abstractions/Entities/IEntityRepository.cs
+++ b/src/EntityDb.Abstractions/Entities/IEntityRepository.cs
@@ -2,10 +2,7 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.ValueObjects;
-using System;
using System.Diagnostics.CodeAnalysis;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Abstractions.Entities;
diff --git a/src/EntityDb.Abstractions/Entities/IEntityRepositoryFactory.cs b/src/EntityDb.Abstractions/Entities/IEntityRepositoryFactory.cs
index 582806d4..975863b1 100644
--- a/src/EntityDb.Abstractions/Entities/IEntityRepositoryFactory.cs
+++ b/src/EntityDb.Abstractions/Entities/IEntityRepositoryFactory.cs
@@ -1,6 +1,3 @@
-using System.Threading;
-using System.Threading.Tasks;
-
namespace EntityDb.Abstractions.Entities;
///
diff --git a/src/EntityDb.Abstractions/Projections/IProjectionRepository.cs b/src/EntityDb.Abstractions/Projections/IProjectionRepository.cs
index a1e76b8a..8d2018d1 100644
--- a/src/EntityDb.Abstractions/Projections/IProjectionRepository.cs
+++ b/src/EntityDb.Abstractions/Projections/IProjectionRepository.cs
@@ -2,10 +2,7 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.ValueObjects;
-using System;
using System.Diagnostics.CodeAnalysis;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Abstractions.Projections;
diff --git a/src/EntityDb.Abstractions/Projections/IProjectionRepositoryFactory.cs b/src/EntityDb.Abstractions/Projections/IProjectionRepositoryFactory.cs
index 1b25c753..a12c6502 100644
--- a/src/EntityDb.Abstractions/Projections/IProjectionRepositoryFactory.cs
+++ b/src/EntityDb.Abstractions/Projections/IProjectionRepositoryFactory.cs
@@ -1,6 +1,3 @@
-using System.Threading;
-using System.Threading.Tasks;
-
namespace EntityDb.Abstractions.Projections;
///
diff --git a/src/EntityDb.Abstractions/Queries/FilterBuilders/IAgentSignatureFilterBuilder.cs b/src/EntityDb.Abstractions/Queries/FilterBuilders/IAgentSignatureFilterBuilder.cs
index f328d187..af4fa3cb 100644
--- a/src/EntityDb.Abstractions/Queries/FilterBuilders/IAgentSignatureFilterBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/FilterBuilders/IAgentSignatureFilterBuilder.cs
@@ -1,5 +1,5 @@
using EntityDb.Abstractions.ValueObjects;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.FilterBuilders;
@@ -10,6 +10,12 @@ namespace EntityDb.Abstractions.Queries.FilterBuilders;
/// The type of filter used by the repository.
public interface IAgentSignatureFilterBuilder : IFilterBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TFilter AgentSignatureMatches(Expression> agentSignatureExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that only includes agentSignatures with any entity id which is contained
/// in a set
@@ -33,16 +39,4 @@ public interface IAgentSignatureFilterBuilder : IFilterBuilder
/// .
///
TFilter AgentSignatureTypeIn(params Type[] agentSignatureTypes);
-
- ///
- /// Returns a that only includes agentSignatures which do match a agentSignature
- /// expression.
- ///
- /// The type of agentSignature in the agentSignature expression.
- /// The agentSignature expression.
- ///
- /// A that only includes agentSignatures which do match
- /// .
- ///
- TFilter AgentSignatureMatches(Expression> agentSignatureExpression);
}
diff --git a/src/EntityDb.Abstractions/Queries/FilterBuilders/ICommandFilterBuilder.cs b/src/EntityDb.Abstractions/Queries/FilterBuilders/ICommandFilterBuilder.cs
index a1f48d63..9b5d2e5a 100644
--- a/src/EntityDb.Abstractions/Queries/FilterBuilders/ICommandFilterBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/FilterBuilders/ICommandFilterBuilder.cs
@@ -1,5 +1,5 @@
using EntityDb.Abstractions.ValueObjects;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.FilterBuilders;
@@ -10,6 +10,12 @@ namespace EntityDb.Abstractions.Queries.FilterBuilders;
/// The type of filter used by the repository.
public interface ICommandFilterBuilder : IFilterBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TFilter CommandMatches(Expression> commandExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that only includes commands with an entity id which is contained in a set
/// of entity ids.
@@ -53,15 +59,4 @@ public interface ICommandFilterBuilder : IFilterBuilder
/// .
///
TFilter CommandTypeIn(params Type[] commandTypes);
-
- ///
- /// Returns a that only includes commands which do match a command expression.
- ///
- /// The type of command in the command expression.
- /// The command expression.
- ///
- /// A that only includes commands which do match
- /// .
- ///
- TFilter CommandMatches(Expression> commandExpression);
}
diff --git a/src/EntityDb.Abstractions/Queries/FilterBuilders/ILeaseFilterBuilder.cs b/src/EntityDb.Abstractions/Queries/FilterBuilders/ILeaseFilterBuilder.cs
index 6ee6bc36..86c06086 100644
--- a/src/EntityDb.Abstractions/Queries/FilterBuilders/ILeaseFilterBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/FilterBuilders/ILeaseFilterBuilder.cs
@@ -1,5 +1,6 @@
-using EntityDb.Abstractions.ValueObjects;
-using System;
+using EntityDb.Abstractions.Leases;
+using EntityDb.Abstractions.ValueObjects;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.FilterBuilders;
@@ -10,6 +11,12 @@ namespace EntityDb.Abstractions.Queries.FilterBuilders;
/// The type of filter used by the repository.
public interface ILeaseFilterBuilder : IFilterBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TFilter LeaseMatches(Expression> leaseExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that only includes leases with an entity id which is contained in a set
/// of entity ids.
@@ -55,13 +62,35 @@ public interface ILeaseFilterBuilder : IFilterBuilder
TFilter LeaseTypeIn(params Type[] leaseTypes);
///
- /// Returns a that only includes leases which do match a lease expression.
+ /// Returns a that only includes leases whose is
+ /// a particular value.
+ ///
+ /// The lease scope
+ ///
+ /// A that only includes leases whose is
+ /// .
+ ///
+ TFilter LeaseScopeEq(string scope);
+
+ ///
+ /// Returns a that only includes leases whose is
+ /// a particular value.
+ ///
+ /// The lease label
+ ///
+ /// A that only includes leases whose is
+ /// .
+ ///
+ TFilter LeaseLabelEq(string label);
+
+ ///
+ /// Returns a that only includes leases whose is
+ /// a particular value.
///
- /// The type of lease in the lease expression.
- /// The lease expression.
+ /// The lease value
///
- /// A that only includes leases which do match
- /// .
+ /// A that only includes leases whose is
+ /// .
///
- TFilter LeaseMatches(Expression> leaseExpression);
+ TFilter LeaseValueEq(string value);
}
diff --git a/src/EntityDb.Abstractions/Queries/FilterBuilders/ITagFilterBuilder.cs b/src/EntityDb.Abstractions/Queries/FilterBuilders/ITagFilterBuilder.cs
index c866ead2..b8454772 100644
--- a/src/EntityDb.Abstractions/Queries/FilterBuilders/ITagFilterBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/FilterBuilders/ITagFilterBuilder.cs
@@ -1,5 +1,6 @@
+using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.FilterBuilders;
@@ -10,6 +11,12 @@ namespace EntityDb.Abstractions.Queries.FilterBuilders;
/// The type of filter used by the repository.
public interface ITagFilterBuilder : IFilterBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TFilter TagMatches(Expression> tagExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that only includes tags with an entity id which is contained in a set of
/// entity ids.
@@ -54,10 +61,24 @@ public interface ITagFilterBuilder : IFilterBuilder
TFilter TagTypeIn(params Type[] tagTypes);
///
- /// Returns a that only includes tags which do match a tag expression.
+ /// Returns a that only includes tags whose is
+ /// a particular value.
+ ///
+ /// The tag labels
+ ///
+ /// A that only includes tags whose is
+ /// .
+ ///
+ TFilter TagLabelEq(string label);
+
+ ///
+ /// Returns a that only includes tags whose is
+ /// a particular value.
///
- /// The type of tag in the tag expression.
- /// The tag expression.
- /// A that only includes tags which do match .
- TFilter TagMatches(Expression> tagExpression);
+ /// The tag values
+ ///
+ /// A that only includes tags whose is
+ /// .
+ ///
+ TFilter TagValueEq(string value);
}
diff --git a/src/EntityDb.Abstractions/Queries/IQuery.cs b/src/EntityDb.Abstractions/Queries/IQuery.cs
index e64d2cc4..5b85d6ac 100644
--- a/src/EntityDb.Abstractions/Queries/IQuery.cs
+++ b/src/EntityDb.Abstractions/Queries/IQuery.cs
@@ -14,4 +14,9 @@ public interface IQuery
/// The number of objects to take.
///
int? Take { get; }
+
+ ///
+ /// Driver-specific options for this query
+ ///
+ object? Options { get; }
}
diff --git a/src/EntityDb.Abstractions/Queries/SortBuilders/IAgentSignatureSortBuilder.cs b/src/EntityDb.Abstractions/Queries/SortBuilders/IAgentSignatureSortBuilder.cs
index 9e792c54..65d75275 100644
--- a/src/EntityDb.Abstractions/Queries/SortBuilders/IAgentSignatureSortBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/SortBuilders/IAgentSignatureSortBuilder.cs
@@ -1,4 +1,4 @@
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.SortBuilders;
@@ -9,6 +9,13 @@ namespace EntityDb.Abstractions.Queries.SortBuilders;
/// The type of sort used by the repository.
public interface IAgentSignatureSortBuilder : ISortBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TSort AgentSignatureProperty(bool ascending,
+ Expression> agentSignatureExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that orders agentSignatures by entity ids.
///
@@ -22,14 +29,4 @@ public interface IAgentSignatureSortBuilder : ISortBuilder
/// Pass true for ascending order or false for descending order.
/// A that orders agentSignatures by type.
TSort AgentSignatureType(bool ascending);
-
- ///
- /// Returns a that orders agentSignatures by a agentSignature expression.
- ///
- /// The type of agentSignature in the agentSignature expression.
- /// Pass true for ascending order or false for descending order.
- /// The agentSignature expression.
- /// A that orders agentSignatures by .
- TSort AgentSignatureProperty(bool ascending,
- Expression> agentSignatureExpression);
}
diff --git a/src/EntityDb.Abstractions/Queries/SortBuilders/ICommandSortBuilder.cs b/src/EntityDb.Abstractions/Queries/SortBuilders/ICommandSortBuilder.cs
index 2a5391cf..e4646c09 100644
--- a/src/EntityDb.Abstractions/Queries/SortBuilders/ICommandSortBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/SortBuilders/ICommandSortBuilder.cs
@@ -1,4 +1,4 @@
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.SortBuilders;
@@ -9,6 +9,12 @@ namespace EntityDb.Abstractions.Queries.SortBuilders;
/// The type of sort used by the repository.
public interface ICommandSortBuilder : ISortBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TSort CommandProperty(bool ascending, Expression> commandExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that orders commands by entity id.
///
@@ -29,13 +35,4 @@ public interface ICommandSortBuilder : ISortBuilder
/// Pass true for ascending order or false for descending order.
/// A that orders commands by type.
TSort CommandType(bool ascending);
-
- ///
- /// Returns a that orders commands by a command expression.
- ///
- /// The type of command in the command expression.
- /// Pass true for ascending order or false for descending order.
- /// The command expression.
- /// A that orders commands by .
- TSort CommandProperty(bool ascending, Expression> commandExpression);
}
diff --git a/src/EntityDb.Abstractions/Queries/SortBuilders/ILeaseSortBuilder.cs b/src/EntityDb.Abstractions/Queries/SortBuilders/ILeaseSortBuilder.cs
index 3aaa2420..310f75cd 100644
--- a/src/EntityDb.Abstractions/Queries/SortBuilders/ILeaseSortBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/SortBuilders/ILeaseSortBuilder.cs
@@ -1,4 +1,5 @@
-using System;
+using EntityDb.Abstractions.Leases;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.SortBuilders;
@@ -9,6 +10,12 @@ namespace EntityDb.Abstractions.Queries.SortBuilders;
/// The type of sort used by the repository.
public interface ILeaseSortBuilder : ISortBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TSort LeaseProperty(bool ascending, Expression> leaseExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that orders leases by entity id.
///
@@ -31,11 +38,23 @@ public interface ILeaseSortBuilder : ISortBuilder
TSort LeaseType(bool ascending);
///
- /// Returns a that orders leases by a lease expression.
+ /// Returns a that orders leases by .
+ ///
+ /// Pass true for ascending order or false for descending order.
+ /// A that orders leases by .
+ TSort LeaseScope(bool ascending);
+
+ ///
+ /// Returns a that orders leases by .
+ ///
+ /// Pass true for ascending order or false for descending order.
+ /// A that orders leases by .
+ TSort LeaseLabel(bool ascending);
+
+ ///
+ /// Returns a that orders leases by .
///
- /// The type of lease in the lease expression.
/// Pass true for ascending order or false for descending order.
- /// The lease expression.
- /// A that orders leases by .
- TSort LeaseProperty(bool ascending, Expression> leaseExpression);
+ /// A that orders leases by .
+ TSort LeaseValue(bool ascending);
}
diff --git a/src/EntityDb.Abstractions/Queries/SortBuilders/ITagSortBuilder.cs b/src/EntityDb.Abstractions/Queries/SortBuilders/ITagSortBuilder.cs
index e846e5d4..b1013780 100644
--- a/src/EntityDb.Abstractions/Queries/SortBuilders/ITagSortBuilder.cs
+++ b/src/EntityDb.Abstractions/Queries/SortBuilders/ITagSortBuilder.cs
@@ -1,4 +1,5 @@
-using System;
+using EntityDb.Abstractions.Tags;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Abstractions.Queries.SortBuilders;
@@ -9,6 +10,12 @@ namespace EntityDb.Abstractions.Queries.SortBuilders;
/// The type of sort used by the repository.
public interface ITagSortBuilder : ISortBuilder
{
+ ///
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ TSort TagProperty(bool ascending, Expression> tagExpression)
+ => throw new NotSupportedException();
+
///
/// Returns a that orders tags by entity id.
///
@@ -31,11 +38,16 @@ public interface ITagSortBuilder : ISortBuilder
TSort TagType(bool ascending);
///
- /// Returns a that orders tags by a tag expression.
+ /// Returns a that orders tags by .
+ ///
+ /// Pass true for ascending order or false for descending order.
+ /// A that orders tags by .
+ TSort TagLabel(bool ascending);
+
+ ///
+ /// Returns a that orders tags by .
///
- /// The type of tag in the tag expression.
/// Pass true for ascending order or false for descending order.
- /// The tag expression.
- /// A that orders tags by .
- TSort TagProperty(bool ascending, Expression> tagExpression);
+ /// A that orders tags by .
+ TSort TagValue(bool ascending);
}
diff --git a/src/EntityDb.Abstractions/Snapshots/ISnapshotRepository.cs b/src/EntityDb.Abstractions/Snapshots/ISnapshotRepository.cs
index 3844189e..6881712a 100644
--- a/src/EntityDb.Abstractions/Snapshots/ISnapshotRepository.cs
+++ b/src/EntityDb.Abstractions/Snapshots/ISnapshotRepository.cs
@@ -1,9 +1,6 @@
using EntityDb.Abstractions.Disposables;
using EntityDb.Abstractions.ValueObjects;
-using System;
using System.Diagnostics.CodeAnalysis;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Abstractions.Snapshots;
diff --git a/src/EntityDb.Abstractions/Snapshots/ISnapshotRepositoryFactory.cs b/src/EntityDb.Abstractions/Snapshots/ISnapshotRepositoryFactory.cs
index 0ea4bfb4..cb5ff674 100644
--- a/src/EntityDb.Abstractions/Snapshots/ISnapshotRepositoryFactory.cs
+++ b/src/EntityDb.Abstractions/Snapshots/ISnapshotRepositoryFactory.cs
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.Disposables;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Abstractions.Snapshots;
diff --git a/src/EntityDb.Abstractions/Transactions/Builders/ITransactionBuilderFactory.cs b/src/EntityDb.Abstractions/Transactions/Builders/ITransactionBuilderFactory.cs
index dd0e3a47..bfedfb7d 100644
--- a/src/EntityDb.Abstractions/Transactions/Builders/ITransactionBuilderFactory.cs
+++ b/src/EntityDb.Abstractions/Transactions/Builders/ITransactionBuilderFactory.cs
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Abstractions.Transactions.Builders;
diff --git a/src/EntityDb.Abstractions/Transactions/ITransactionRepository.cs b/src/EntityDb.Abstractions/Transactions/ITransactionRepository.cs
index fda634f7..c8c78de2 100644
--- a/src/EntityDb.Abstractions/Transactions/ITransactionRepository.cs
+++ b/src/EntityDb.Abstractions/Transactions/ITransactionRepository.cs
@@ -4,8 +4,7 @@
using EntityDb.Abstractions.Queries;
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
-using System.Threading;
-using System.Threading.Tasks;
+using System.Diagnostics.CodeAnalysis;
namespace EntityDb.Abstractions.Transactions;
@@ -14,13 +13,166 @@ namespace EntityDb.Abstractions.Transactions;
///
public interface ITransactionRepository : IDisposableResource
{
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateTransactionIds instead! This method will be removed at a future date.")]
+ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateTransactionIds(agentSignatureQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateTransactionIds instead! This method will be removed at a future date.")]
+ Task GetTransactionIds(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateTransactionIds(commandQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateTransactionIds instead! This method will be removed at a future date.")]
+ Task GetTransactionIds(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateTransactionIds(leaseQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateTransactionIds instead! This method will be removed at a future date.")]
+ Task GetTransactionIds(ITagQuery tagQuery, CancellationToken cancellationToken = default)
+ {
+ return EnumerateTransactionIds(tagQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateEntityIds instead! This method will be removed at a future date.")]
+ public Task GetEntityIds(IAgentSignatureQuery agentSignatureQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateEntityIds(agentSignatureQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateEntityIds instead! This method will be removed at a future date.")]
+ public Task GetEntityIds(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateEntityIds(commandQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateEntityIds instead! This method will be removed at a future date.")]
+ public Task GetEntityIds(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateEntityIds(leaseQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateEntityIds instead! This method will be removed at a future date.")]
+ public Task GetEntityIds(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateEntityIds(tagQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateAgentSignatures instead! This method will be removed at a future date.")]
+ Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateAgentSignatures(agentSignatureQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateCommands instead! This method will be removed at a future date.")]
+ Task GetCommands(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateCommands(commandQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateLeases instead! This method will be removed at a future date.")]
+ Task GetLeases(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateLeases(leaseQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateTags instead! This method will be removed at a future date.")]
+ Task GetTags(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateTags(tagQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateAnnotatedAgentSignatures instead! This method will be removed at a future date.")]
+ Task[]> GetAnnotatedAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateAnnotatedAgentSignatures(agentSignatureQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
+ ///
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
+ [Obsolete("Please use EnumerateAnnotatedCommands instead! This method will be removed at a future date.")]
+ Task[]> GetAnnotatedCommands(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
+ {
+ return EnumerateAnnotatedCommands(commandQuery, cancellationToken)
+ .ToArrayAsync(cancellationToken)
+ .AsTask();
+ }
+
///
/// Returns the transaction ids which are found by a agentSignature query.
///
/// The agentSignature query.
/// A cancellation token.
/// The transaction ids which are found by .
- Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
+ IAsyncEnumerable EnumerateTransactionIds(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default);
///
@@ -29,7 +181,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The command query.
/// A cancellation token.
/// The transaction ids which are found by .
- Task GetTransactionIds(ICommandQuery commandQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateTransactionIds(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the transaction ids which are found by a lease query.
@@ -37,7 +190,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The lease query.
/// A cancellation token.
/// The transaction ids which are found by .
- Task GetTransactionIds(ILeaseQuery leaseQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateTransactionIds(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the transaction ids which are found by a tag query.
@@ -45,7 +199,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The tag query.
/// A cancellation token.
/// The transaction ids which are found by .
- Task GetTransactionIds(ITagQuery tagQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateTransactionIds(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the entity ids which are found by a agentSignature query.
@@ -53,7 +208,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The agentSignature query.
/// A cancellation token.
/// The entity ids which are found by .
- Task GetEntityIds(IAgentSignatureQuery agentSignatureQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateEntityIds(IAgentSignatureQuery agentSignatureQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the entity ids which are found by a command query.
@@ -61,7 +217,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The command query.
/// A cancellation token.
/// The entity ids which are found by .
- Task GetEntityIds(ICommandQuery commandQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateEntityIds(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the entity ids which are found by a lease query.
@@ -69,7 +226,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The lease query.
/// A cancellation token.
/// The entity ids which are found by .
- Task GetEntityIds(ILeaseQuery leaseQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateEntityIds(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the entity ids which are found by a tag query.
@@ -77,7 +235,8 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The tag query.
/// A cancellation token.
/// The entity ids which are found by .
- Task GetEntityIds(ITagQuery tagQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateEntityIds(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the agentSignatures which are found by a agentSignature query.
@@ -85,7 +244,7 @@ Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
/// The agentSignature query.
/// A cancellation token.
/// The agentSignatures which are found by .
- Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
+ IAsyncEnumerable EnumerateAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default);
///
@@ -94,7 +253,8 @@ Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
/// The command query.
/// A cancellation token.
/// The commands which are found by .
- Task GetCommands(ICommandQuery commandQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateCommands(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the leases which are found by a lease query.
@@ -102,7 +262,8 @@ Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
/// The lease query.
/// A cancellation token.
/// The leases which are found by .
- Task GetLeases(ILeaseQuery leaseQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateLeases(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the tags which are found by a tag query.
@@ -110,7 +271,8 @@ Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
/// The tag query.
/// A cancellation token.
/// The tags which are found by .
- Task GetTags(ITagQuery tagQuery, CancellationToken cancellationToken = default);
+ IAsyncEnumerable EnumerateTags(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default);
///
/// Returns the annotated agent signatures which are found by an agent signature query.
@@ -118,7 +280,7 @@ Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
/// The agent signature query.
/// A cancellation token.
/// The annotated agent signatures which are found by .
- Task[]> GetAnnotatedAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
+ IAsyncEnumerable> EnumerateAnnotatedAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default);
///
@@ -127,7 +289,7 @@ Task[]> GetAnnotatedAgentSignatures(IAgentSignatureQ
/// The command query.
/// A cancellation token.
/// The annotated commands which are found by .
- Task[]> GetAnnotatedCommands(ICommandQuery commandQuery,
+ IAsyncEnumerable> EnumerateAnnotatedCommands(ICommandQuery commandQuery,
CancellationToken cancellationToken = default);
///
diff --git a/src/EntityDb.Abstractions/Transactions/ITransactionRepositoryFactory.cs b/src/EntityDb.Abstractions/Transactions/ITransactionRepositoryFactory.cs
index eb1778f2..18dc6d0a 100644
--- a/src/EntityDb.Abstractions/Transactions/ITransactionRepositoryFactory.cs
+++ b/src/EntityDb.Abstractions/Transactions/ITransactionRepositoryFactory.cs
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.Disposables;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Abstractions.Transactions;
diff --git a/src/EntityDb.Abstractions/ValueObjects/Id.cs b/src/EntityDb.Abstractions/ValueObjects/Id.cs
index 9d57c38b..200b26e5 100644
--- a/src/EntityDb.Abstractions/ValueObjects/Id.cs
+++ b/src/EntityDb.Abstractions/ValueObjects/Id.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace EntityDb.Abstractions.ValueObjects;
///
diff --git a/src/EntityDb.Abstractions/ValueObjects/TimeStamp.cs b/src/EntityDb.Abstractions/ValueObjects/TimeStamp.cs
index 00171e5f..12cac34e 100644
--- a/src/EntityDb.Abstractions/ValueObjects/TimeStamp.cs
+++ b/src/EntityDb.Abstractions/ValueObjects/TimeStamp.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Globalization;
+using System.Globalization;
namespace EntityDb.Abstractions.ValueObjects;
@@ -9,6 +8,8 @@ namespace EntityDb.Abstractions.ValueObjects;
/// The backing value.
public readonly record struct TimeStamp(DateTime Value)
{
+ private const long TicksPerMicrosecond = TimeSpan.TicksPerMillisecond / 1000;
+
///
/// The value of this constant is equivalent to 00:00:00.0000000 UTC, January 1, 1970.
///
@@ -28,6 +29,15 @@ public TimeStamp WithMillisecondPrecision()
return new TimeStamp(Value - TimeSpan.FromTicks(Value.Ticks % TimeSpan.TicksPerMillisecond));
}
+ ///
+ /// Gets a rounded down to the nearest microsecond.
+ ///
+ /// A rounded down to the nearest microsecond.
+ public TimeStamp WithMicrosecondPrecision()
+ {
+ return new TimeStamp(Value - TimeSpan.FromTicks(Value.Ticks % TicksPerMicrosecond));
+ }
+
///
/// Converts the value of the current object to
/// its equivalent string representation using the formatting
diff --git a/src/EntityDb.Abstractions/packages.lock.json b/src/EntityDb.Abstractions/packages.lock.json
index 2fca7fd9..7636783a 100644
--- a/src/EntityDb.Abstractions/packages.lock.json
+++ b/src/EntityDb.Abstractions/packages.lock.json
@@ -1,6 +1,21 @@
{
"version": 1,
"dependencies": {
- "net6.0": {}
+ "net6.0": {
+ "System.Linq.Async": {
+ "type": "Direct",
+ "requested": "[6.0.1, )",
+ "resolved": "6.0.1",
+ "contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
+ "dependencies": {
+ "Microsoft.Bcl.AsyncInterfaces": "6.0.0"
+ }
+ },
+ "Microsoft.Bcl.AsyncInterfaces": {
+ "type": "Transitive",
+ "resolved": "6.0.0",
+ "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/EntityDb.Common/Agents/AgentAccessorChain.cs b/src/EntityDb.Common/Agents/AgentAccessorChain.cs
index ebcb33de..a6d9f5d2 100644
--- a/src/EntityDb.Common/Agents/AgentAccessorChain.cs
+++ b/src/EntityDb.Common/Agents/AgentAccessorChain.cs
@@ -3,10 +3,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
-using System;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Agents;
diff --git a/src/EntityDb.Common/Agents/AgentAccessorChainOptions.cs b/src/EntityDb.Common/Agents/AgentAccessorChainOptions.cs
index d6480699..b63bd145 100644
--- a/src/EntityDb.Common/Agents/AgentAccessorChainOptions.cs
+++ b/src/EntityDb.Common/Agents/AgentAccessorChainOptions.cs
@@ -1,7 +1,5 @@
using EntityDb.Abstractions.Agents;
using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
namespace EntityDb.Common.Agents;
diff --git a/src/EntityDb.Common/Agents/UnknownAgentAccessor.cs b/src/EntityDb.Common/Agents/UnknownAgentAccessor.cs
index 4a9526e7..c06be995 100644
--- a/src/EntityDb.Common/Agents/UnknownAgentAccessor.cs
+++ b/src/EntityDb.Common/Agents/UnknownAgentAccessor.cs
@@ -1,7 +1,4 @@
using EntityDb.Abstractions.Agents;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Agents;
diff --git a/src/EntityDb.Common/Agents/UnknownAgentSignature.cs b/src/EntityDb.Common/Agents/UnknownAgentSignature.cs
index 9a9f8b20..b10b02a4 100644
--- a/src/EntityDb.Common/Agents/UnknownAgentSignature.cs
+++ b/src/EntityDb.Common/Agents/UnknownAgentSignature.cs
@@ -1,6 +1,4 @@
-using System.Collections.Generic;
-
-namespace EntityDb.Common.Agents;
+namespace EntityDb.Common.Agents;
///
/// Represents the signature of an unknown actor.
diff --git a/src/EntityDb.Common/Annotations/EntitiesAnnotation.cs b/src/EntityDb.Common/Annotations/EntitiesAnnotation.cs
index d172f014..e765b92a 100644
--- a/src/EntityDb.Common/Annotations/EntitiesAnnotation.cs
+++ b/src/EntityDb.Common/Annotations/EntitiesAnnotation.cs
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Annotations;
using EntityDb.Abstractions.ValueObjects;
-using System;
namespace EntityDb.Common.Annotations;
diff --git a/src/EntityDb.Common/Annotations/EntityAnnotation.cs b/src/EntityDb.Common/Annotations/EntityAnnotation.cs
index 753cabad..597f0d8f 100644
--- a/src/EntityDb.Common/Annotations/EntityAnnotation.cs
+++ b/src/EntityDb.Common/Annotations/EntityAnnotation.cs
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Annotations;
using EntityDb.Abstractions.ValueObjects;
-using System;
namespace EntityDb.Common.Annotations;
diff --git a/src/EntityDb.Common/Commands/IAddLeasesCommand.cs b/src/EntityDb.Common/Commands/IAddLeasesCommand.cs
index 99c7a2a3..3064a044 100644
--- a/src/EntityDb.Common/Commands/IAddLeasesCommand.cs
+++ b/src/EntityDb.Common/Commands/IAddLeasesCommand.cs
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Leases;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
-using System.Collections.Generic;
namespace EntityDb.Common.Commands;
diff --git a/src/EntityDb.Common/Commands/IAddTagsCommand.cs b/src/EntityDb.Common/Commands/IAddTagsCommand.cs
index 4f0809c9..305a4b35 100644
--- a/src/EntityDb.Common/Commands/IAddTagsCommand.cs
+++ b/src/EntityDb.Common/Commands/IAddTagsCommand.cs
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
-using System.Collections.Generic;
namespace EntityDb.Common.Commands;
diff --git a/src/EntityDb.Common/Commands/IDeleteLeasesCommand.cs b/src/EntityDb.Common/Commands/IDeleteLeasesCommand.cs
index 76293c7b..a8931b2d 100644
--- a/src/EntityDb.Common/Commands/IDeleteLeasesCommand.cs
+++ b/src/EntityDb.Common/Commands/IDeleteLeasesCommand.cs
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Leases;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
-using System.Collections.Generic;
namespace EntityDb.Common.Commands;
diff --git a/src/EntityDb.Common/Commands/IDeleteTagsCommand.cs b/src/EntityDb.Common/Commands/IDeleteTagsCommand.cs
index d408a1e6..3fb14693 100644
--- a/src/EntityDb.Common/Commands/IDeleteTagsCommand.cs
+++ b/src/EntityDb.Common/Commands/IDeleteTagsCommand.cs
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
-using System.Collections.Generic;
namespace EntityDb.Common.Commands;
diff --git a/src/EntityDb.Common/Disposables/DisposableResourceBaseClass.cs b/src/EntityDb.Common/Disposables/DisposableResourceBaseClass.cs
index d0ae36f2..084045af 100644
--- a/src/EntityDb.Common/Disposables/DisposableResourceBaseClass.cs
+++ b/src/EntityDb.Common/Disposables/DisposableResourceBaseClass.cs
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Disposables;
using System.Diagnostics.CodeAnalysis;
-using System.Threading.Tasks;
namespace EntityDb.Common.Disposables;
diff --git a/src/EntityDb.Common/Disposables/DisposableResourceBaseRecord.cs b/src/EntityDb.Common/Disposables/DisposableResourceBaseRecord.cs
index 340d7669..caf4597c 100644
--- a/src/EntityDb.Common/Disposables/DisposableResourceBaseRecord.cs
+++ b/src/EntityDb.Common/Disposables/DisposableResourceBaseRecord.cs
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Disposables;
using System.Diagnostics.CodeAnalysis;
-using System.Threading.Tasks;
namespace EntityDb.Common.Disposables;
diff --git a/src/EntityDb.Common/Documents/IEntitiesDocument.cs b/src/EntityDb.Common/Documents/IEntitiesDocument.cs
new file mode 100644
index 00000000..3ba5cfe5
--- /dev/null
+++ b/src/EntityDb.Common/Documents/IEntitiesDocument.cs
@@ -0,0 +1,8 @@
+using EntityDb.Abstractions.ValueObjects;
+
+namespace EntityDb.Common.Documents;
+
+internal interface IEntitiesDocument : ITransactionDocument
+{
+ Id[] EntityIds { get; }
+}
diff --git a/src/EntityDb.Common/Documents/IEntityDocument.cs b/src/EntityDb.Common/Documents/IEntityDocument.cs
new file mode 100644
index 00000000..d6ae722c
--- /dev/null
+++ b/src/EntityDb.Common/Documents/IEntityDocument.cs
@@ -0,0 +1,9 @@
+using EntityDb.Abstractions.ValueObjects;
+
+namespace EntityDb.Common.Documents;
+
+internal interface IEntityDocument : ITransactionDocument
+{
+ Id EntityId { get; }
+ VersionNumber EntityVersionNumber { get; }
+}
diff --git a/src/EntityDb.Common/Documents/ITransactionDocument.cs b/src/EntityDb.Common/Documents/ITransactionDocument.cs
new file mode 100644
index 00000000..8008b49b
--- /dev/null
+++ b/src/EntityDb.Common/Documents/ITransactionDocument.cs
@@ -0,0 +1,14 @@
+using EntityDb.Abstractions.ValueObjects;
+
+namespace EntityDb.Common.Documents;
+
+internal interface ITransactionDocument
+{
+ Id TransactionId { get; }
+
+ TimeStamp TransactionTimeStamp { get; }
+
+ string DataType { get; }
+
+ TSerializedData Data { get; }
+}
diff --git a/src/EntityDb.Common/Entities/EntityRepository.cs b/src/EntityDb.Common/Entities/EntityRepository.cs
index 4c5fd6c6..a7db31fd 100644
--- a/src/EntityDb.Common/Entities/EntityRepository.cs
+++ b/src/EntityDb.Common/Entities/EntityRepository.cs
@@ -6,10 +6,6 @@
using EntityDb.Common.Exceptions;
using EntityDb.Common.Queries;
using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Entities;
@@ -42,9 +38,14 @@ public async Task GetSnapshot(Pointer entityPointer, CancellationToken
var commandQuery = new GetEntityCommandsQuery(entityPointer, snapshot.GetVersionNumber());
- var commands = await TransactionRepository.GetCommands(commandQuery, cancellationToken);
+ var commands = TransactionRepository.EnumerateCommands(commandQuery, cancellationToken);
- var entity = snapshot.Reduce(commands);
+ var entity = snapshot;
+
+ await foreach (var command in commands)
+ {
+ entity = entity.Reduce(command);
+ }
if (!entityPointer.IsSatisfiedBy(entity.GetVersionNumber()))
{
diff --git a/src/EntityDb.Common/Entities/EntityRepositoryFactory.cs b/src/EntityDb.Common/Entities/EntityRepositoryFactory.cs
index 38956c75..0519305c 100644
--- a/src/EntityDb.Common/Entities/EntityRepositoryFactory.cs
+++ b/src/EntityDb.Common/Entities/EntityRepositoryFactory.cs
@@ -1,9 +1,6 @@
using EntityDb.Abstractions.Entities;
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.Transactions;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Entities;
diff --git a/src/EntityDb.Common/Entities/IEntity.cs b/src/EntityDb.Common/Entities/IEntity.cs
index baa9c618..a0b3ac9a 100644
--- a/src/EntityDb.Common/Entities/IEntity.cs
+++ b/src/EntityDb.Common/Entities/IEntity.cs
@@ -8,10 +8,17 @@ namespace EntityDb.Common.Entities;
/// The type of the entity.
public interface IEntity : ISnapshot
{
+ ///
+ [Obsolete("Please use Reduce(object) instead. This method is no longer in supported.", true)]
+ TEntity Reduce(params object[] command)
+ {
+ throw new NotSupportedException();
+ }
+
///
/// Returns a new that incorporates the commands.
///
- /// The commands
- /// A new that incorporates .
- TEntity Reduce(params object[] commands);
+ /// The command
+ /// A new that incorporates .
+ TEntity Reduce(object command);
}
diff --git a/src/EntityDb.Common/Envelopes/EnvelopeHeaders.cs b/src/EntityDb.Common/Envelopes/EnvelopeHeaders.cs
index e007f50d..6c076033 100644
--- a/src/EntityDb.Common/Envelopes/EnvelopeHeaders.cs
+++ b/src/EntityDb.Common/Envelopes/EnvelopeHeaders.cs
@@ -1,6 +1,4 @@
using EntityDb.Common.TypeResolvers;
-using System;
-using System.Collections.Generic;
namespace EntityDb.Common.Envelopes;
diff --git a/src/EntityDb.Common/Envelopes/EnvelopeHelper.cs b/src/EntityDb.Common/Envelopes/EnvelopeHelper.cs
index e5310467..81c45e15 100644
--- a/src/EntityDb.Common/Envelopes/EnvelopeHelper.cs
+++ b/src/EntityDb.Common/Envelopes/EnvelopeHelper.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
+using System.Diagnostics.CodeAnalysis;
namespace EntityDb.Common.Envelopes;
diff --git a/src/EntityDb.Common/Envelopes/IEnvelopeService.cs b/src/EntityDb.Common/Envelopes/IEnvelopeService.cs
index e4e35366..4f3a3e31 100644
--- a/src/EntityDb.Common/Envelopes/IEnvelopeService.cs
+++ b/src/EntityDb.Common/Envelopes/IEnvelopeService.cs
@@ -1,12 +1,8 @@
namespace EntityDb.Common.Envelopes;
-internal interface IEnvelopeService
+internal interface IEnvelopeService
{
- Envelope Deconstruct(TData data);
+ TSerializedData Serialize(TData data);
- byte[] Serialize(Envelope envelope);
-
- Envelope Deserialize(byte[] rawData);
-
- TData Reconstruct(Envelope envelope);
+ TData Deserialize(TSerializedData serializedData);
}
diff --git a/src/EntityDb.Common/Exceptions/CannotResolveTypeException.cs b/src/EntityDb.Common/Exceptions/CannotResolveTypeException.cs
index 5fe6cd47..477ca4b4 100644
--- a/src/EntityDb.Common/Exceptions/CannotResolveTypeException.cs
+++ b/src/EntityDb.Common/Exceptions/CannotResolveTypeException.cs
@@ -1,5 +1,4 @@
using EntityDb.Common.TypeResolvers;
-using System;
namespace EntityDb.Common.Exceptions;
diff --git a/src/EntityDb.Common/Exceptions/CannotWriteInReadOnlyModeException.cs b/src/EntityDb.Common/Exceptions/CannotWriteInReadOnlyModeException.cs
index ce3fa12b..fddbef98 100644
--- a/src/EntityDb.Common/Exceptions/CannotWriteInReadOnlyModeException.cs
+++ b/src/EntityDb.Common/Exceptions/CannotWriteInReadOnlyModeException.cs
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.Transactions;
-using System;
namespace EntityDb.Common.Exceptions;
diff --git a/src/EntityDb.Common/Exceptions/DeserializeException.cs b/src/EntityDb.Common/Exceptions/DeserializeException.cs
index 97d2ec27..ce345af7 100644
--- a/src/EntityDb.Common/Exceptions/DeserializeException.cs
+++ b/src/EntityDb.Common/Exceptions/DeserializeException.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace EntityDb.Common.Exceptions;
+namespace EntityDb.Common.Exceptions;
///
/// The exception that is thrown when an object envelope cannot be deserialized. Possible objects include:
diff --git a/src/EntityDb.Common/Exceptions/EntityAlreadyKnownException.cs b/src/EntityDb.Common/Exceptions/EntityAlreadyKnownException.cs
index cb5ded65..0aa2967a 100644
--- a/src/EntityDb.Common/Exceptions/EntityAlreadyKnownException.cs
+++ b/src/EntityDb.Common/Exceptions/EntityAlreadyKnownException.cs
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
-using System;
namespace EntityDb.Common.Exceptions;
diff --git a/src/EntityDb.Common/Exceptions/NoAgentException.cs b/src/EntityDb.Common/Exceptions/NoAgentException.cs
index e5f251d1..519773fb 100644
--- a/src/EntityDb.Common/Exceptions/NoAgentException.cs
+++ b/src/EntityDb.Common/Exceptions/NoAgentException.cs
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.Agents;
-using System;
namespace EntityDb.Common.Exceptions;
diff --git a/src/EntityDb.Common/Exceptions/OptimisticConcurrencyException.cs b/src/EntityDb.Common/Exceptions/OptimisticConcurrencyException.cs
index 9e4fc7dd..3f89bd68 100644
--- a/src/EntityDb.Common/Exceptions/OptimisticConcurrencyException.cs
+++ b/src/EntityDb.Common/Exceptions/OptimisticConcurrencyException.cs
@@ -2,8 +2,6 @@
using EntityDb.Abstractions.Transactions.Steps;
using EntityDb.Abstractions.ValueObjects;
using Microsoft.Extensions.Logging;
-using System;
-using System.Threading;
namespace EntityDb.Common.Exceptions;
diff --git a/src/EntityDb.Common/Exceptions/SerializeException.cs b/src/EntityDb.Common/Exceptions/SerializeException.cs
index 7f080cd7..5b807cdb 100644
--- a/src/EntityDb.Common/Exceptions/SerializeException.cs
+++ b/src/EntityDb.Common/Exceptions/SerializeException.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace EntityDb.Common.Exceptions;
+namespace EntityDb.Common.Exceptions;
///
/// The exception that is thrown when an object envelope cannot be serialized. Possible objects include:
diff --git a/src/EntityDb.Common/Exceptions/SnapshotPointerDoesNotExistException.cs b/src/EntityDb.Common/Exceptions/SnapshotPointerDoesNotExistException.cs
index 9ce07b72..134defd2 100644
--- a/src/EntityDb.Common/Exceptions/SnapshotPointerDoesNotExistException.cs
+++ b/src/EntityDb.Common/Exceptions/SnapshotPointerDoesNotExistException.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace EntityDb.Common.Exceptions;
+namespace EntityDb.Common.Exceptions;
///
/// The exception that is thrown when an actor requests a snapshot that does not exist.
diff --git a/src/EntityDb.Common/Exceptions/VersionZeroReservedException.cs b/src/EntityDb.Common/Exceptions/VersionZeroReservedException.cs
index cb28e73f..fffc3a52 100644
--- a/src/EntityDb.Common/Exceptions/VersionZeroReservedException.cs
+++ b/src/EntityDb.Common/Exceptions/VersionZeroReservedException.cs
@@ -1,8 +1,6 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.Transactions.Steps;
using EntityDb.Abstractions.ValueObjects;
-using System;
-using System.Threading;
namespace EntityDb.Common.Exceptions;
diff --git a/src/EntityDb.Common/Extensions/DocumentsExtensions.cs b/src/EntityDb.Common/Extensions/DocumentsExtensions.cs
new file mode 100644
index 00000000..9e71994e
--- /dev/null
+++ b/src/EntityDb.Common/Extensions/DocumentsExtensions.cs
@@ -0,0 +1,87 @@
+using EntityDb.Abstractions.Annotations;
+using EntityDb.Abstractions.ValueObjects;
+using EntityDb.Common.Annotations;
+using EntityDb.Common.Documents;
+using EntityDb.Common.Envelopes;
+using System.Runtime.CompilerServices;
+
+namespace EntityDb.Common.Extensions;
+
+internal static class DocumentsExtensions
+{
+ public static IAsyncEnumerable EnumerateIds
+ (
+ this IAsyncEnumerable documents,
+ int? skip,
+ int? limit,
+ Func, IAsyncEnumerable> mapToIds
+ )
+ {
+ var ids = mapToIds
+ .Invoke(documents)
+ .Distinct();
+
+ if (skip.HasValue)
+ {
+ ids = ids.Skip(skip.Value);
+ }
+
+ if (limit.HasValue)
+ {
+ ids = ids.Take(limit.Value);
+ }
+
+ return ids;
+ }
+
+ public static async IAsyncEnumerable> EnumerateEntityAnnotation
+ (
+ this IAsyncEnumerable documents,
+ IEnvelopeService envelopeService,
+ [EnumeratorCancellation] CancellationToken cancellationToken
+ )
+ where TDocument : IEntityDocument
+ where TData : notnull
+ {
+ await using var enumerator = documents.GetAsyncEnumerator(cancellationToken);
+
+ while (await enumerator.MoveNextAsync(cancellationToken))
+ {
+ var document = enumerator.Current;
+
+ yield return EntityAnnotation.CreateFromBoxedData
+ (
+ document.TransactionId,
+ document.TransactionTimeStamp,
+ document.EntityId,
+ document.EntityVersionNumber,
+ envelopeService.Deserialize(document.Data)
+ );
+ }
+ }
+
+ public static async IAsyncEnumerable> EnumerateEntitiesAnnotation
+ (
+ this IAsyncEnumerable documents,
+ IEnvelopeService envelopeService,
+ [EnumeratorCancellation] CancellationToken cancellationToken
+ )
+ where TDocument : IEntitiesDocument
+ where TData : notnull
+ {
+ await using var enumerator = documents.GetAsyncEnumerator(cancellationToken);
+
+ while (await enumerator.MoveNextAsync(cancellationToken))
+ {
+ var document = enumerator.Current;
+
+ yield return EntitiesAnnotation.CreateFromBoxedData
+ (
+ document.TransactionId,
+ document.TransactionTimeStamp,
+ document.EntityIds,
+ envelopeService.Deserialize(document.Data)
+ );
+ }
+ }
+}
diff --git a/src/EntityDb.Common/Extensions/EnvelopeServiceExtensions.cs b/src/EntityDb.Common/Extensions/EnvelopeServiceExtensions.cs
deleted file mode 100644
index 7a7198e5..00000000
--- a/src/EntityDb.Common/Extensions/EnvelopeServiceExtensions.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using EntityDb.Common.Envelopes;
-
-namespace EntityDb.Common.Extensions;
-
-internal static class EnvelopeServiceExtensions
-{
- public static byte[] DeconstructAndSerialize(this IEnvelopeService envelopeService,
- TData data)
- {
- var envelope = envelopeService.Deconstruct(data);
-
- return envelopeService.Serialize(envelope);
- }
-
- public static TData DeserializeAndReconstruct(this IEnvelopeService envelopeService,
- byte[] rawData)
- {
- var envelope = envelopeService.Deserialize(rawData);
-
- return envelopeService.Reconstruct(envelope);
- }
-}
diff --git a/src/EntityDb.Common/Extensions/ServiceCollectionExtensions.cs b/src/EntityDb.Common/Extensions/ServiceCollectionExtensions.cs
index 782d5b39..dcb7b740 100644
--- a/src/EntityDb.Common/Extensions/ServiceCollectionExtensions.cs
+++ b/src/EntityDb.Common/Extensions/ServiceCollectionExtensions.cs
@@ -11,7 +11,6 @@
using EntityDb.Common.Transactions.Subscribers.Processors;
using EntityDb.Common.TypeResolvers;
using Microsoft.Extensions.DependencyInjection;
-using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Threading.Tasks.Dataflow;
@@ -50,6 +49,13 @@ internal static void Add(this IServiceCollection serviceCollection, Se
serviceCollection.Add(new ServiceDescriptor(typeof(TService), serviceFactory, serviceLifetime));
}
+ internal static void Add(this IServiceCollection serviceCollection, ServiceLifetime serviceLifetime)
+ where TService : class
+ where TImplementation : TService
+ {
+ serviceCollection.Add(new ServiceDescriptor(typeof(TService), typeof(TImplementation), serviceLifetime));
+ }
+
internal static void Add(this IServiceCollection serviceCollection, ServiceLifetime serviceLifetime)
where TService : class
{
diff --git a/src/EntityDb.Common/Polyfills/AsyncEnumerablePolyfill.cs b/src/EntityDb.Common/Polyfills/AsyncEnumerablePolyfill.cs
new file mode 100644
index 00000000..86667912
--- /dev/null
+++ b/src/EntityDb.Common/Polyfills/AsyncEnumerablePolyfill.cs
@@ -0,0 +1,33 @@
+namespace EntityDb.Common.Polyfills;
+
+internal static class AsyncEnumerablePolyfill
+{
+ public static IAsyncEnumerable FromResult(IEnumerable enumerable)
+ {
+ var enumerator = enumerable.GetEnumerator();
+ var current = default(T);
+
+ var asyncEnumerator = AsyncEnumerator.Create
+ (
+ () =>
+ {
+ var moveNext = enumerator.MoveNext();
+
+ current = moveNext
+ ? enumerator.Current
+ : default;
+
+ return ValueTask.FromResult(moveNext);
+ },
+ () => current!,
+ () =>
+ {
+ enumerator.Dispose();
+
+ return ValueTask.CompletedTask;
+ }
+ );
+
+ return AsyncEnumerable.Create(_ => asyncEnumerator);
+ }
+}
diff --git a/src/EntityDb.Common/Projections/IProjection.cs b/src/EntityDb.Common/Projections/IProjection.cs
index 7cfc98b6..3706a13d 100644
--- a/src/EntityDb.Common/Projections/IProjection.cs
+++ b/src/EntityDb.Common/Projections/IProjection.cs
@@ -12,11 +12,11 @@ namespace EntityDb.Common.Projections;
public interface IProjection : ISnapshot
{
///
- /// Returns a new that incorporates the commands for a particular entity id.
+ /// Returns a new that incorporates the command for a particular entity id.
///
- /// The annotated commands.
- /// A new that incorporates .
- TProjection Reduce(params IEntityAnnotation[] annotatedCommands);
+ /// The annotated command.
+ /// A new that incorporates .
+ TProjection Reduce(IEntityAnnotation annotatedCommand);
///
/// Returns a that is used to load the rest of the state for the given projection pointer.
diff --git a/src/EntityDb.Common/Projections/ProjectionRepository.cs b/src/EntityDb.Common/Projections/ProjectionRepository.cs
index 271bf315..a36af76d 100644
--- a/src/EntityDb.Common/Projections/ProjectionRepository.cs
+++ b/src/EntityDb.Common/Projections/ProjectionRepository.cs
@@ -5,9 +5,6 @@
using EntityDb.Common.Disposables;
using EntityDb.Common.Exceptions;
using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Projections;
@@ -43,9 +40,12 @@ public async Task GetSnapshot(Pointer projectionPointer, Cancellati
var commandQuery = projection.GetCommandQuery(projectionPointer);
- var annotatedCommands = await TransactionRepository.GetAnnotatedCommands(commandQuery, cancellationToken);
+ var annotatedCommands = TransactionRepository.EnumerateAnnotatedCommands(commandQuery, cancellationToken);
- projection = projection.Reduce(annotatedCommands);
+ await foreach (var annotatedCommand in annotatedCommands)
+ {
+ projection = projection.Reduce(annotatedCommand);
+ }
if (!projectionPointer.IsSatisfiedBy(projection.GetVersionNumber()))
{
diff --git a/src/EntityDb.Common/Projections/ProjectionRepositoryFactory.cs b/src/EntityDb.Common/Projections/ProjectionRepositoryFactory.cs
index 66ce8c8e..2db48c92 100644
--- a/src/EntityDb.Common/Projections/ProjectionRepositoryFactory.cs
+++ b/src/EntityDb.Common/Projections/ProjectionRepositoryFactory.cs
@@ -1,9 +1,6 @@
using EntityDb.Abstractions.Projections;
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.Transactions;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Projections;
diff --git a/src/EntityDb.Common/Properties/AssemblyInfo.cs b/src/EntityDb.Common/Properties/AssemblyInfo.cs
index 79b6e821..7c37e040 100644
--- a/src/EntityDb.Common/Properties/AssemblyInfo.cs
+++ b/src/EntityDb.Common/Properties/AssemblyInfo.cs
@@ -1,12 +1,16 @@
using System.Runtime.CompilerServices;
// src
+[assembly: InternalsVisibleTo("EntityDb.SqlDb")]
+[assembly: InternalsVisibleTo("EntityDb.Npgsql")]
+[assembly: InternalsVisibleTo("EntityDb.Npgsql.Provisioner")]
[assembly: InternalsVisibleTo("EntityDb.InMemory")]
[assembly: InternalsVisibleTo("EntityDb.MongoDb")]
[assembly: InternalsVisibleTo("EntityDb.MongoDb.Provisioner")]
[assembly: InternalsVisibleTo("EntityDb.Mvc")]
[assembly: InternalsVisibleTo("EntityDb.Redis")]
[assembly: InternalsVisibleTo("EntityDb.Void")]
+[assembly: InternalsVisibleTo("EntityDb.Json")]
// test
[assembly: InternalsVisibleTo("EntityDb.Common.Tests")]
diff --git a/src/EntityDb.Common/Queries/DeleteLeasesQuery.cs b/src/EntityDb.Common/Queries/DeleteLeasesQuery.cs
index 10c88ef8..bec312f5 100644
--- a/src/EntityDb.Common/Queries/DeleteLeasesQuery.cs
+++ b/src/EntityDb.Common/Queries/DeleteLeasesQuery.cs
@@ -3,13 +3,10 @@
using EntityDb.Abstractions.Queries.FilterBuilders;
using EntityDb.Abstractions.Queries.SortBuilders;
using EntityDb.Abstractions.ValueObjects;
-using EntityDb.Common.Leases;
-using System.Collections.Generic;
-using System.Linq;
namespace EntityDb.Common.Queries;
-internal sealed record DeleteLeasesQuery(Id EntityId, IReadOnlyCollection Leases) : ILeaseQuery
+internal sealed record DeleteLeasesQuery(Id EntityId, IReadOnlyCollection Leases, object? Options = null) : ILeaseQuery
{
public TFilter GetFilter(ILeaseFilterBuilder builder)
{
@@ -19,10 +16,11 @@ public TFilter GetFilter(ILeaseFilterBuilder builder)
builder.Or
(
Leases
- .Select(deleteLease => builder.LeaseMatches((Lease lease) =>
- lease.Scope == deleteLease.Scope &&
- lease.Label == deleteLease.Label &&
- lease.Value == deleteLease.Value))
+ .Select(deleteLease => builder.And(
+ builder.LeaseScopeEq(deleteLease.Scope),
+ builder.LeaseLabelEq(deleteLease.Label),
+ builder.LeaseValueEq(deleteLease.Value)
+ ))
.ToArray()
)
);
diff --git a/src/EntityDb.Common/Queries/DeleteTagsQuery.cs b/src/EntityDb.Common/Queries/DeleteTagsQuery.cs
index fbb05b00..36d80348 100644
--- a/src/EntityDb.Common/Queries/DeleteTagsQuery.cs
+++ b/src/EntityDb.Common/Queries/DeleteTagsQuery.cs
@@ -3,13 +3,10 @@
using EntityDb.Abstractions.Queries.SortBuilders;
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
-using EntityDb.Common.Tags;
-using System.Collections.Generic;
-using System.Linq;
namespace EntityDb.Common.Queries;
-internal sealed record DeleteTagsQuery(Id EntityId, IReadOnlyCollection Tags) : ITagQuery
+internal sealed record DeleteTagsQuery(Id EntityId, IReadOnlyCollection Tags, object? Options = null) : ITagQuery
{
public TFilter GetFilter(ITagFilterBuilder builder)
{
@@ -19,9 +16,10 @@ public TFilter GetFilter(ITagFilterBuilder builder)
builder.Or
(
Tags
- .Select(deleteLease => builder.TagMatches((Tag lease) =>
- lease.Label == deleteLease.Label &&
- lease.Value == deleteLease.Value))
+ .Select(deleteTag => builder.And(
+ builder.TagLabelEq(deleteTag.Label),
+ builder.TagValueEq(deleteTag.Value)
+ ))
.ToArray()
)
);
diff --git a/src/EntityDb.Common/Queries/GetEntityQuery.cs b/src/EntityDb.Common/Queries/GetEntityQuery.cs
index 06147670..023cec32 100644
--- a/src/EntityDb.Common/Queries/GetEntityQuery.cs
+++ b/src/EntityDb.Common/Queries/GetEntityQuery.cs
@@ -2,12 +2,11 @@
using EntityDb.Abstractions.Queries.FilterBuilders;
using EntityDb.Abstractions.Queries.SortBuilders;
using EntityDb.Abstractions.ValueObjects;
-using System.Collections.Generic;
namespace EntityDb.Common.Queries;
internal sealed record GetEntityCommandsQuery
- (Pointer EntityPointer, VersionNumber SnapshotVersionNumber) : ICommandQuery
+ (Pointer EntityPointer, VersionNumber SnapshotVersionNumber, object? Options = null) : ICommandQuery
{
public TFilter GetFilter(ICommandFilterBuilder builder)
{
diff --git a/src/EntityDb.Common/Queries/GetLastEntityVersionQuery.cs b/src/EntityDb.Common/Queries/GetLastEntityVersionQuery.cs
index 779acf6f..2eda63d3 100644
--- a/src/EntityDb.Common/Queries/GetLastEntityVersionQuery.cs
+++ b/src/EntityDb.Common/Queries/GetLastEntityVersionQuery.cs
@@ -5,7 +5,7 @@
namespace EntityDb.Common.Queries;
-internal sealed record GetLastEntityCommandQuery(Id EntityId) : ICommandQuery
+internal sealed record GetLastEntityCommandQuery(Id EntityId, object? Options = null) : ICommandQuery
{
public TFilter GetFilter(ICommandFilterBuilder builder)
{
diff --git a/src/EntityDb.Common/Queries/Modified/ModifiedQueryBase.cs b/src/EntityDb.Common/Queries/Modified/ModifiedQueryBase.cs
index e16233c1..21e7c06f 100644
--- a/src/EntityDb.Common/Queries/Modified/ModifiedQueryBase.cs
+++ b/src/EntityDb.Common/Queries/Modified/ModifiedQueryBase.cs
@@ -7,4 +7,6 @@ internal abstract record ModifiedQueryBase(IQuery Query, ModifiedQueryOptions Mo
public int? Skip => ModifiedQueryOptions.ReplaceSkip ?? Query.Skip;
public int? Take => ModifiedQueryOptions.ReplaceTake ?? Query.Take;
+
+ public object? Options => Query.Options;
}
diff --git a/src/EntityDb.Common/Queries/SortBuilders/AgentSignatureReverseSortBuilder.cs b/src/EntityDb.Common/Queries/SortBuilders/AgentSignatureReverseSortBuilder.cs
index c28334d6..c406503a 100644
--- a/src/EntityDb.Common/Queries/SortBuilders/AgentSignatureReverseSortBuilder.cs
+++ b/src/EntityDb.Common/Queries/SortBuilders/AgentSignatureReverseSortBuilder.cs
@@ -1,5 +1,5 @@
using EntityDb.Abstractions.Queries.SortBuilders;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Common.Queries.SortBuilders;
@@ -19,6 +19,8 @@ public TSort AgentSignatureType(bool ascending)
return AgentSignatureSortBuilder.AgentSignatureType(!ascending);
}
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
public TSort AgentSignatureProperty(bool ascending,
Expression> agentSignatureExpression)
{
diff --git a/src/EntityDb.Common/Queries/SortBuilders/CommandReverseSortBuilder.cs b/src/EntityDb.Common/Queries/SortBuilders/CommandReverseSortBuilder.cs
index 755223b6..361eab9b 100644
--- a/src/EntityDb.Common/Queries/SortBuilders/CommandReverseSortBuilder.cs
+++ b/src/EntityDb.Common/Queries/SortBuilders/CommandReverseSortBuilder.cs
@@ -1,5 +1,5 @@
using EntityDb.Abstractions.Queries.SortBuilders;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Common.Queries.SortBuilders;
@@ -23,6 +23,8 @@ public TSort CommandType(bool ascending)
return CommandSortBuilder.CommandType(!ascending);
}
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
public TSort CommandProperty(bool ascending, Expression> commandExpression)
{
return CommandSortBuilder.CommandProperty(!ascending, commandExpression);
diff --git a/src/EntityDb.Common/Queries/SortBuilders/LeaseReverseSortBuilder.cs b/src/EntityDb.Common/Queries/SortBuilders/LeaseReverseSortBuilder.cs
index d43db0a2..e8161b5d 100644
--- a/src/EntityDb.Common/Queries/SortBuilders/LeaseReverseSortBuilder.cs
+++ b/src/EntityDb.Common/Queries/SortBuilders/LeaseReverseSortBuilder.cs
@@ -1,5 +1,5 @@
using EntityDb.Abstractions.Queries.SortBuilders;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Common.Queries.SortBuilders;
@@ -23,8 +23,25 @@ public TSort LeaseType(bool ascending)
return LeaseSortBuilder.LeaseType(!ascending);
}
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
public TSort LeaseProperty(bool ascending, Expression> leaseExpression)
{
return LeaseSortBuilder.LeaseProperty(!ascending, leaseExpression);
}
+
+ public TSort LeaseScope(bool ascending)
+ {
+ return LeaseSortBuilder.LeaseScope(!ascending);
+ }
+
+ public TSort LeaseLabel(bool ascending)
+ {
+ return LeaseSortBuilder.LeaseLabel(!ascending);
+ }
+
+ public TSort LeaseValue(bool ascending)
+ {
+ return LeaseSortBuilder.LeaseValue(!ascending);
+ }
}
diff --git a/src/EntityDb.Common/Queries/SortBuilders/TagReverseSortBuilder.cs b/src/EntityDb.Common/Queries/SortBuilders/TagReverseSortBuilder.cs
index 2c04f5cc..fa3364bc 100644
--- a/src/EntityDb.Common/Queries/SortBuilders/TagReverseSortBuilder.cs
+++ b/src/EntityDb.Common/Queries/SortBuilders/TagReverseSortBuilder.cs
@@ -1,5 +1,5 @@
using EntityDb.Abstractions.Queries.SortBuilders;
-using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
namespace EntityDb.Common.Queries.SortBuilders;
@@ -22,8 +22,20 @@ public TSort TagType(bool ascending)
return TagSortBuilder.TagType(!ascending);
}
+ [Obsolete("This method will be removed in the future, and may not be supported for all implementations.")]
+ [ExcludeFromCodeCoverage(Justification = "Obsolete")]
public TSort TagProperty(bool ascending, Expression> tagExpression)
{
return TagSortBuilder.TagProperty(!ascending, tagExpression);
}
+
+ public TSort TagLabel(bool ascending)
+ {
+ return TagSortBuilder.TagLabel(!ascending);
+ }
+
+ public TSort TagValue(bool ascending)
+ {
+ return TagSortBuilder.TagValue(!ascending);
+ }
}
diff --git a/src/EntityDb.Common/Snapshots/ISnapshot.cs b/src/EntityDb.Common/Snapshots/ISnapshot.cs
index f2b2820b..2941c86f 100644
--- a/src/EntityDb.Common/Snapshots/ISnapshot.cs
+++ b/src/EntityDb.Common/Snapshots/ISnapshot.cs
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
-using System;
using System.Diagnostics.CodeAnalysis;
namespace EntityDb.Common.Snapshots;
diff --git a/src/EntityDb.Common/Snapshots/SnapshotRepositoryWrapper.cs b/src/EntityDb.Common/Snapshots/SnapshotRepositoryWrapper.cs
index c4544187..ffee245d 100644
--- a/src/EntityDb.Common/Snapshots/SnapshotRepositoryWrapper.cs
+++ b/src/EntityDb.Common/Snapshots/SnapshotRepositoryWrapper.cs
@@ -1,9 +1,6 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Disposables;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Snapshots;
diff --git a/src/EntityDb.Common/Snapshots/TestModeRedisSnapshotRepository.cs b/src/EntityDb.Common/Snapshots/TestModeRedisSnapshotRepository.cs
index 9e02e5f8..809b5e95 100644
--- a/src/EntityDb.Common/Snapshots/TestModeRedisSnapshotRepository.cs
+++ b/src/EntityDb.Common/Snapshots/TestModeRedisSnapshotRepository.cs
@@ -1,8 +1,6 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Disposables;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Snapshots;
diff --git a/src/EntityDb.Common/Snapshots/TestModeSnapshotManager.cs b/src/EntityDb.Common/Snapshots/TestModeSnapshotManager.cs
index 174730b1..af984dec 100644
--- a/src/EntityDb.Common/Snapshots/TestModeSnapshotManager.cs
+++ b/src/EntityDb.Common/Snapshots/TestModeSnapshotManager.cs
@@ -1,9 +1,6 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Disposables;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
namespace EntityDb.Common.Snapshots;
diff --git a/src/EntityDb.Common/Snapshots/TestModeSnapshotRepositoryFactory.cs b/src/EntityDb.Common/Snapshots/TestModeSnapshotRepositoryFactory.cs
index 03f25cf3..4fe3eb23 100644
--- a/src/EntityDb.Common/Snapshots/TestModeSnapshotRepositoryFactory.cs
+++ b/src/EntityDb.Common/Snapshots/TestModeSnapshotRepositoryFactory.cs
@@ -1,7 +1,5 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Common.Disposables;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Snapshots;
diff --git a/src/EntityDb.Common/Snapshots/TryCatchSnapshotRepository.cs b/src/EntityDb.Common/Snapshots/TryCatchSnapshotRepository.cs
index 087b143c..fe2ea5c0 100644
--- a/src/EntityDb.Common/Snapshots/TryCatchSnapshotRepository.cs
+++ b/src/EntityDb.Common/Snapshots/TryCatchSnapshotRepository.cs
@@ -1,8 +1,6 @@
using EntityDb.Abstractions.Snapshots;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using System;
-using System.Threading.Tasks;
namespace EntityDb.Common.Snapshots;
diff --git a/src/EntityDb.Common/Transactions/Builders/TransactionBuilder.cs b/src/EntityDb.Common/Transactions/Builders/TransactionBuilder.cs
index 8c88abc4..f8be43df 100644
--- a/src/EntityDb.Common/Transactions/Builders/TransactionBuilder.cs
+++ b/src/EntityDb.Common/Transactions/Builders/TransactionBuilder.cs
@@ -9,7 +9,6 @@
using EntityDb.Common.Entities;
using EntityDb.Common.Exceptions;
using EntityDb.Common.Transactions.Steps;
-using System.Collections.Generic;
using System.Collections.Immutable;
namespace EntityDb.Common.Transactions.Builders;
diff --git a/src/EntityDb.Common/Transactions/Builders/TransactionBuilderFactory.cs b/src/EntityDb.Common/Transactions/Builders/TransactionBuilderFactory.cs
index 52bc58bc..8820f425 100644
--- a/src/EntityDb.Common/Transactions/Builders/TransactionBuilderFactory.cs
+++ b/src/EntityDb.Common/Transactions/Builders/TransactionBuilderFactory.cs
@@ -2,8 +2,6 @@
using EntityDb.Abstractions.Transactions.Builders;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Entities;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Builders;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/BufferBlockTransactionQueue.cs b/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/BufferBlockTransactionQueue.cs
index 428908e5..662ccc10 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/BufferBlockTransactionQueue.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/BufferBlockTransactionQueue.cs
@@ -2,10 +2,7 @@
using EntityDb.Common.Transactions.Subscribers.Processors;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
-using System;
using System.Diagnostics.CodeAnalysis;
-using System.Threading;
-using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
namespace EntityDb.Common.Transactions.Subscribers.ProcessorQueues;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/TestModeTransactionQueue.cs b/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/TestModeTransactionQueue.cs
index 5fd1e7b0..24ce7a94 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/TestModeTransactionQueue.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/ProcessorQueues/TestModeTransactionQueue.cs
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Common.Transactions.Subscribers.Processors;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.ProcessorQueues;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionProcessor.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionProcessor.cs
index e6de5eb7..b1016cde 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionProcessor.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionProcessor.cs
@@ -2,9 +2,6 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Common.Entities;
using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionStepProcessor.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionStepProcessor.cs
index a7894370..9f28ccf2 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionStepProcessor.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/EntitySnapshotTransactionStepProcessor.cs
@@ -2,8 +2,6 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.Transactions.Steps;
using EntityDb.Abstractions.ValueObjects;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionProcessor.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionProcessor.cs
index efb82474..09cffee9 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionProcessor.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionProcessor.cs
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.Transactions;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionStepProcessor.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionStepProcessor.cs
index ffbedbd3..7a7ff34f 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionStepProcessor.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/ITransactionStepProcessor.cs
@@ -1,7 +1,5 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.Transactions.Steps;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionProcessor.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionProcessor.cs
index 468cbbca..0912fec2 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionProcessor.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionProcessor.cs
@@ -2,9 +2,6 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Common.Projections;
using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionStepProcessor.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionStepProcessor.cs
index 69bf4ed2..e433c6d8 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionStepProcessor.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/ProjectionSnapshotTransactionStepProcessor.cs
@@ -4,8 +4,6 @@
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Annotations;
using EntityDb.Common.Projections;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionProcessorBase.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionProcessorBase.cs
index 72350cc0..b08dc096 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionProcessorBase.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionProcessorBase.cs
@@ -2,9 +2,6 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Snapshots;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionStepProcessorCache.cs b/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionStepProcessorCache.cs
index ef071b92..c1b9d051 100644
--- a/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionStepProcessorCache.cs
+++ b/src/EntityDb.Common/Transactions/Subscribers/Processors/SnapshotTransactionStepProcessorCache.cs
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
-using System.Collections.Generic;
namespace EntityDb.Common.Transactions.Subscribers.Processors;
diff --git a/src/EntityDb.Common/Transactions/TransactionRepositoryWrapper.cs b/src/EntityDb.Common/Transactions/TransactionRepositoryWrapper.cs
index 16d1e501..39cf5811 100644
--- a/src/EntityDb.Common/Transactions/TransactionRepositoryWrapper.cs
+++ b/src/EntityDb.Common/Transactions/TransactionRepositoryWrapper.cs
@@ -5,9 +5,6 @@
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Disposables;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions;
@@ -20,80 +17,88 @@ protected TransactionRepositoryWrapper(ITransactionRepository transactionReposit
_transactionRepository = transactionRepository;
}
- public Task GetTransactionIds(IAgentSignatureQuery agentSignatureQuery,
+ public IAsyncEnumerable EnumerateTransactionIds(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetTransactionIds(agentSignatureQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateTransactionIds(agentSignatureQuery, cancellationToken));
}
- public Task GetTransactionIds(ICommandQuery commandQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateTransactionIds(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetTransactionIds(commandQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateTransactionIds(commandQuery, cancellationToken));
}
- public Task GetTransactionIds(ILeaseQuery leaseQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateTransactionIds(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetTransactionIds(leaseQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateTransactionIds(leaseQuery, cancellationToken));
}
- public Task GetTransactionIds(ITagQuery tagQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateTransactionIds(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetTransactionIds(tagQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateTransactionIds(tagQuery, cancellationToken));
}
- public Task GetEntityIds(IAgentSignatureQuery agentSignatureQuery,
+ public IAsyncEnumerable EnumerateEntityIds(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetEntityIds(agentSignatureQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateEntityIds(agentSignatureQuery, cancellationToken));
}
- public Task GetEntityIds(ICommandQuery commandQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateEntityIds(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetEntityIds(commandQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateEntityIds(commandQuery, cancellationToken));
}
- public Task GetEntityIds(ILeaseQuery leaseQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateEntityIds(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetEntityIds(leaseQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateEntityIds(leaseQuery, cancellationToken));
}
- public Task GetEntityIds(ITagQuery tagQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateEntityIds(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetEntityIds(tagQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateEntityIds(tagQuery, cancellationToken));
}
- public Task GetAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
+ public IAsyncEnumerable EnumerateAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetAgentSignatures(agentSignatureQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateAgentSignatures(agentSignatureQuery, cancellationToken));
}
- public Task GetCommands(ICommandQuery commandQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateCommands(ICommandQuery commandQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetCommands(commandQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateCommands(commandQuery, cancellationToken));
}
- public Task GetLeases(ILeaseQuery leaseQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateLeases(ILeaseQuery leaseQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetLeases(leaseQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateLeases(leaseQuery, cancellationToken));
}
- public Task GetTags(ITagQuery tagQuery, CancellationToken cancellationToken = default)
+ public IAsyncEnumerable EnumerateTags(ITagQuery tagQuery,
+ CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetTags(tagQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateTags(tagQuery, cancellationToken));
}
- public Task[]> GetAnnotatedAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
+ public IAsyncEnumerable> EnumerateAnnotatedAgentSignatures(IAgentSignatureQuery agentSignatureQuery,
CancellationToken cancellationToken = default)
{
- return WrapQuery(() =>
- _transactionRepository.GetAnnotatedAgentSignatures(agentSignatureQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateAnnotatedAgentSignatures(agentSignatureQuery, cancellationToken));
}
- public Task[]> GetAnnotatedCommands(ICommandQuery commandQuery,
+ public IAsyncEnumerable> EnumerateAnnotatedCommands(ICommandQuery commandQuery,
CancellationToken cancellationToken = default)
{
- return WrapQuery(() => _transactionRepository.GetAnnotatedCommands(commandQuery, cancellationToken));
+ return WrapQuery(() => _transactionRepository.EnumerateAnnotatedCommands(commandQuery, cancellationToken));
}
public Task PutTransaction(ITransaction transaction, CancellationToken cancellationToken = default)
@@ -106,7 +111,7 @@ public override async ValueTask DisposeAsync()
await _transactionRepository.DisposeAsync();
}
- protected abstract Task WrapQuery(Func> task);
+ protected abstract IAsyncEnumerable WrapQuery(Func> enumerable);
protected abstract Task WrapCommand(Func> task);
}
diff --git a/src/EntityDb.Common/Transactions/TryCatchTransactionRepository.cs b/src/EntityDb.Common/Transactions/TryCatchTransactionRepository.cs
index a91e45d2..279bcd50 100644
--- a/src/EntityDb.Common/Transactions/TryCatchTransactionRepository.cs
+++ b/src/EntityDb.Common/Transactions/TryCatchTransactionRepository.cs
@@ -1,8 +1,6 @@
using EntityDb.Abstractions.Transactions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using System;
-using System.Threading.Tasks;
namespace EntityDb.Common.Transactions;
@@ -19,19 +17,40 @@ ILogger logger
_logger = logger;
}
- protected override async Task WrapQuery(Func> task)
+ protected override async IAsyncEnumerable WrapQuery(Func> enumerable)
{
using (_logger.BeginScope("TryCatchId: {TryCatchId}", Guid.NewGuid()))
{
+ IAsyncEnumerator enumerator;
+
try
{
- return await task.Invoke();
+ enumerator = enumerable.Invoke().GetAsyncEnumerator();
}
catch (Exception exception)
{
_logger.LogError(exception, "The operation cannot be completed");
- return Array.Empty();
+ yield break;
+ }
+
+ while (true)
+ {
+ try
+ {
+ if (!await enumerator.MoveNextAsync())
+ {
+ yield break;
+ }
+ }
+ catch (Exception exception)
+ {
+ _logger.LogError(exception, "The operation cannot be completed");
+
+ yield break;
+ }
+
+ yield return enumerator.Current;
}
}
}
diff --git a/src/EntityDb.Common/TypeResolvers/DefaultPartialTypeResolver.cs b/src/EntityDb.Common/TypeResolvers/DefaultPartialTypeResolver.cs
index 14c66da9..4c5fd840 100644
--- a/src/EntityDb.Common/TypeResolvers/DefaultPartialTypeResolver.cs
+++ b/src/EntityDb.Common/TypeResolvers/DefaultPartialTypeResolver.cs
@@ -1,5 +1,4 @@
using EntityDb.Common.Envelopes;
-using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
diff --git a/src/EntityDb.Common/TypeResolvers/IPartialTypeResolver.cs b/src/EntityDb.Common/TypeResolvers/IPartialTypeResolver.cs
index 9531b8b8..ea25634c 100644
--- a/src/EntityDb.Common/TypeResolvers/IPartialTypeResolver.cs
+++ b/src/EntityDb.Common/TypeResolvers/IPartialTypeResolver.cs
@@ -1,5 +1,4 @@
using EntityDb.Common.Envelopes;
-using System;
using System.Diagnostics.CodeAnalysis;
namespace EntityDb.Common.TypeResolvers;
diff --git a/src/EntityDb.Common/TypeResolvers/ITypeResolver.cs b/src/EntityDb.Common/TypeResolvers/ITypeResolver.cs
index 48d055de..0ae418e9 100644
--- a/src/EntityDb.Common/TypeResolvers/ITypeResolver.cs
+++ b/src/EntityDb.Common/TypeResolvers/ITypeResolver.cs
@@ -1,5 +1,4 @@
using EntityDb.Common.Envelopes;
-using System;
namespace EntityDb.Common.TypeResolvers;
diff --git a/src/EntityDb.Common/TypeResolvers/LifoTypeResolver.cs b/src/EntityDb.Common/TypeResolvers/LifoTypeResolver.cs
index bd73d453..5859bcda 100644
--- a/src/EntityDb.Common/TypeResolvers/LifoTypeResolver.cs
+++ b/src/EntityDb.Common/TypeResolvers/LifoTypeResolver.cs
@@ -1,9 +1,6 @@
using EntityDb.Common.Envelopes;
using EntityDb.Common.Exceptions;
using Microsoft.Extensions.Logging;
-using System;
-using System.Collections.Generic;
-using System.Linq;
namespace EntityDb.Common.TypeResolvers;
diff --git a/src/EntityDb.Common/TypeResolvers/MemberInfoNamePartialTypeResolver.cs b/src/EntityDb.Common/TypeResolvers/MemberInfoNamePartialTypeResolver.cs
index bc189c3f..59fa5351 100644
--- a/src/EntityDb.Common/TypeResolvers/MemberInfoNamePartialTypeResolver.cs
+++ b/src/EntityDb.Common/TypeResolvers/MemberInfoNamePartialTypeResolver.cs
@@ -1,8 +1,5 @@
using EntityDb.Common.Envelopes;
-using System;
-using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
-using System.Linq;
namespace EntityDb.Common.TypeResolvers;
diff --git a/src/EntityDb.Common/packages.lock.json b/src/EntityDb.Common/packages.lock.json
index a36eeb96..7cf0e02d 100644
--- a/src/EntityDb.Common/packages.lock.json
+++ b/src/EntityDb.Common/packages.lock.json
@@ -2,8 +2,25 @@
"version": 1,
"dependencies": {
"net6.0": {
+ "System.Linq.Async": {
+ "type": "Direct",
+ "requested": "[6.0.1, )",
+ "resolved": "6.0.1",
+ "contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
+ "dependencies": {
+ "Microsoft.Bcl.AsyncInterfaces": "6.0.0"
+ }
+ },
+ "Microsoft.Bcl.AsyncInterfaces": {
+ "type": "Transitive",
+ "resolved": "6.0.0",
+ "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
+ },
"entitydb.abstractions": {
- "type": "Project"
+ "type": "Project",
+ "dependencies": {
+ "System.Linq.Async": "6.0.1"
+ }
}
}
}
diff --git a/src/EntityDb.EventStore/packages.lock.json b/src/EntityDb.EventStore/packages.lock.json
new file mode 100644
index 00000000..db3b32d0
--- /dev/null
+++ b/src/EntityDb.EventStore/packages.lock.json
@@ -0,0 +1,748 @@
+{
+ "version": 1,
+ "dependencies": {
+ "net6.0": {
+ "EventStore.Client": {
+ "type": "Direct",
+ "requested": "[21.2.2, )",
+ "resolved": "21.2.2",
+ "contentHash": "3xLQEOkpOMCm5/2Spk6mFwqFBowYw9pA9Np3K+YVF0yMh2KCQGW/21iV6CdT9XRtB+CzoKDYDhaZlsvaFpfbPQ==",
+ "dependencies": {
+ "Newtonsoft.Json": "11.0.2",
+ "System.Net.Http": "4.3.4",
+ "protobuf-net": "2.4.0"
+ }
+ },
+ "EventStore.Client.Grpc.Streams": {
+ "type": "Direct",
+ "requested": "[22.0.0, )",
+ "resolved": "22.0.0",
+ "contentHash": "LNZxzw3nse5kp7rr5aJS65OR0zmhdEatYx12miy7W8Bno8vqEaGYFtMjDUsfuC5JPw2VwUw9LW9KypfOjpf/Wg==",
+ "dependencies": {
+ "EventStore.Client.Grpc": "22.0.0"
+ }
+ },
+ "System.Linq.Async": {
+ "type": "Direct",
+ "requested": "[6.0.1, )",
+ "resolved": "6.0.1",
+ "contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
+ "dependencies": {
+ "Microsoft.Bcl.AsyncInterfaces": "6.0.0"
+ }
+ },
+ "EventStore.Client.Grpc": {
+ "type": "Transitive",
+ "resolved": "22.0.0",
+ "contentHash": "DwPcpRkKRDX1c7wjCqbeGFXF2vsqWu+O1f3Y/iNCf+07nzP8N04/L/5LUheuKeyQogoh3t+I4koAOUitUdsSQw==",
+ "dependencies": {
+ "Google.Protobuf": "3.15.0",
+ "Grpc.Net.Client": "2.40.0",
+ "Microsoft.Extensions.Logging": "5.0.0",
+ "System.Linq.Async": "5.0.0"
+ }
+ },
+ "Google.Protobuf": {
+ "type": "Transitive",
+ "resolved": "3.15.0",
+ "contentHash": "2na7LsYrtxkEQaVCNjaafBzVu4IJ4U4+dwwBazK8oUkpDiIFjO0GkyTc+IbStx4xNVAV4EqHl+qp2uegFgFiiA==",
+ "dependencies": {
+ "System.Memory": "4.5.3",
+ "System.Runtime.CompilerServices.Unsafe": "4.5.2"
+ }
+ },
+ "Grpc.Core.Api": {
+ "type": "Transitive",
+ "resolved": "2.40.0",
+ "contentHash": "Ig3ioHBMDl8jZzPRU+t8GPpgDBYkjwupHzSVswwrsUVZdO5SThmYY4fHftNC1rMCjsjVvUMQ/o1NCf1CT4Y+rA==",
+ "dependencies": {
+ "System.Memory": "4.5.3"
+ }
+ },
+ "Grpc.Net.Client": {
+ "type": "Transitive",
+ "resolved": "2.40.0",
+ "contentHash": "+Z+onJ5jOLwKR41wROs+I1Bo6+NKT9ov/moXZCi9vH7aDRVQuqhmfALoxWdsNUNO9Bl3A/VzmfPB2jxZB4B1WQ==",
+ "dependencies": {
+ "Grpc.Net.Common": "2.40.0",
+ "Microsoft.Extensions.Logging.Abstractions": "3.0.3"
+ }
+ },
+ "Grpc.Net.Common": {
+ "type": "Transitive",
+ "resolved": "2.40.0",
+ "contentHash": "nj5XotYmzAT4UlGyOK6xWacPp2nODupQvlbeA2qqu9F47BIr+vze6+psJ9gSgED2HeTVBXuc+vdKrUXzk0ErMQ==",
+ "dependencies": {
+ "Grpc.Core.Api": "2.40.0"
+ }
+ },
+ "Microsoft.Bcl.AsyncInterfaces": {
+ "type": "Transitive",
+ "resolved": "6.0.0",
+ "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
+ },
+ "Microsoft.Extensions.DependencyInjection": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "Rc2kb/p3Ze6cP6rhFC3PJRdWGbLvSHZc0ev7YlyeU6FmHciDMLrhoVoTUEzKPhN5ZjFgKF1Cf5fOz8mCMIkvpA==",
+ "dependencies": {
+ "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0"
+ }
+ },
+ "Microsoft.Extensions.DependencyInjection.Abstractions": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "ORj7Zh81gC69TyvmcUm9tSzytcy8AVousi+IVRAI8nLieQjOFryRusSFh7+aLk16FN9pQNqJAiMd7BTKINK0kA=="
+ },
+ "Microsoft.Extensions.Logging": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "MgOwK6tPzB6YNH21wssJcw/2MKwee8b2gI7SllYfn6rvTpIrVvVS5HAjSU2vqSku1fwqRvWP0MdIi14qjd93Aw==",
+ "dependencies": {
+ "Microsoft.Extensions.DependencyInjection": "5.0.0",
+ "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0",
+ "Microsoft.Extensions.Logging.Abstractions": "5.0.0",
+ "Microsoft.Extensions.Options": "5.0.0"
+ }
+ },
+ "Microsoft.Extensions.Logging.Abstractions": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "NxP6ahFcBnnSfwNBi2KH2Oz8Xl5Sm2krjId/jRR3I7teFphwiUoUeZPwTNA21EX+5PtjqmyAvKaOeBXcJjcH/w=="
+ },
+ "Microsoft.Extensions.Options": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "CBvR92TCJ5uBIdd9/HzDSrxYak+0W/3+yxrNg8Qm6Bmrkh5L+nu6m3WeazQehcZ5q1/6dDA7J5YdQjim0165zg==",
+ "dependencies": {
+ "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0",
+ "Microsoft.Extensions.Primitives": "5.0.0"
+ }
+ },
+ "Microsoft.Extensions.Primitives": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "cI/VWn9G1fghXrNDagX9nYaaB/nokkZn0HYAawGaELQrl8InSezfe9OnfPZLcJq3esXxygh3hkq2c3qoV3SDyQ=="
+ },
+ "Microsoft.NETCore.Platforms": {
+ "type": "Transitive",
+ "resolved": "2.1.0",
+ "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA=="
+ },
+ "Microsoft.NETCore.Targets": {
+ "type": "Transitive",
+ "resolved": "1.1.0",
+ "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
+ },
+ "Newtonsoft.Json": {
+ "type": "Transitive",
+ "resolved": "11.0.2",
+ "contentHash": "IvJe1pj7JHEsP8B8J8DwlMEx8UInrs/x+9oVY+oCD13jpLu4JbJU2WCIsMRn5C4yW9+DgkaO8uiVE5VHKjpmdQ=="
+ },
+ "protobuf-net": {
+ "type": "Transitive",
+ "resolved": "2.4.0",
+ "contentHash": "j37MD1p1s9NdX8P5+IaY2J9p2382xiL1VP3mxYu0g+G/kf2YM2grFa1jJPO+0WDJNl1XhNPO0Q5yBEcbX77hBQ==",
+ "dependencies": {
+ "System.ServiceModel.Primitives": "4.5.3"
+ }
+ },
+ "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g=="
+ },
+ "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw=="
+ },
+ "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg=="
+ },
+ "runtime.native.System": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0"
+ }
+ },
+ "runtime.native.System.Net.Http": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0"
+ }
+ },
+ "runtime.native.System.Security.Cryptography.Apple": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==",
+ "dependencies": {
+ "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0"
+ }
+ },
+ "runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==",
+ "dependencies": {
+ "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2",
+ "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2"
+ }
+ },
+ "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ=="
+ },
+ "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA=="
+ },
+ "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ=="
+ },
+ "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w=="
+ },
+ "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg=="
+ },
+ "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw=="
+ },
+ "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w=="
+ },
+ "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.2",
+ "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg=="
+ },
+ "System.Collections": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Collections.Concurrent": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==",
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Diagnostics.Tracing": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Threading": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.Diagnostics.Debug": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Diagnostics.DiagnosticSource": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "tD6kosZnTAGdrEa0tZSuFyunMbt/5KYDnHdndJYGqZoNy00XVXyACd5d6KnE1YgYv3ne2CjtAfNXo/fwEhnKUA==",
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Tracing": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Threading": "4.3.0"
+ }
+ },
+ "System.Diagnostics.Tracing": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Globalization": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Globalization.Calendars": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Globalization": "4.3.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Globalization.Extensions": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "System.Globalization": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0"
+ }
+ },
+ "System.IO": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.IO.FileSystem": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.IO": "4.3.0",
+ "System.IO.FileSystem.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.IO.FileSystem.Primitives": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==",
+ "dependencies": {
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Linq": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==",
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0"
+ }
+ },
+ "System.Memory": {
+ "type": "Transitive",
+ "resolved": "4.5.3",
+ "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA=="
+ },
+ "System.Net.Http": {
+ "type": "Transitive",
+ "resolved": "4.3.4",
+ "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.1",
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Diagnostics.DiagnosticSource": "4.3.0",
+ "System.Diagnostics.Tracing": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.Globalization.Extensions": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.IO.FileSystem": "4.3.0",
+ "System.Net.Primitives": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Security.Cryptography.Algorithms": "4.3.0",
+ "System.Security.Cryptography.Encoding": "4.3.0",
+ "System.Security.Cryptography.OpenSsl": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Security.Cryptography.X509Certificates": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading": "4.3.0",
+ "System.Threading.Tasks": "4.3.0",
+ "runtime.native.System": "4.3.0",
+ "runtime.native.System.Net.Http": "4.3.0",
+ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2"
+ }
+ },
+ "System.Net.Primitives": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Handles": "4.3.0"
+ }
+ },
+ "System.Private.ServiceModel": {
+ "type": "Transitive",
+ "resolved": "4.5.3",
+ "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "2.1.0",
+ "System.Reflection.DispatchProxy": "4.5.0",
+ "System.Security.Principal.Windows": "4.5.0"
+ }
+ },
+ "System.Reflection": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.IO": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Reflection.DispatchProxy": {
+ "type": "Transitive",
+ "resolved": "4.5.0",
+ "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA=="
+ },
+ "System.Reflection.Primitives": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Resources.ResourceManager": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Globalization": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Runtime": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0"
+ }
+ },
+ "System.Runtime.CompilerServices.Unsafe": {
+ "type": "Transitive",
+ "resolved": "4.5.2",
+ "contentHash": "wprSFgext8cwqymChhrBLu62LMg/1u92bU+VOwyfBimSPVFXtsNqEWC92Pf9ofzJFlk4IHmJA75EDJn1b2goAQ=="
+ },
+ "System.Runtime.Extensions": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Runtime.Handles": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Runtime.InteropServices": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Reflection": "4.3.0",
+ "System.Reflection.Primitives": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Handles": "4.3.0"
+ }
+ },
+ "System.Runtime.Numerics": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==",
+ "dependencies": {
+ "System.Globalization": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.Algorithms": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "System.Collections": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Runtime.Numerics": "4.3.0",
+ "System.Security.Cryptography.Encoding": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "runtime.native.System.Security.Cryptography.Apple": "4.3.0",
+ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.Cng": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "System.IO": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Security.Cryptography.Algorithms": "4.3.0",
+ "System.Security.Cryptography.Encoding": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Text.Encoding": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.Csp": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "System.IO": "4.3.0",
+ "System.Reflection": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Security.Cryptography.Algorithms": "4.3.0",
+ "System.Security.Cryptography.Encoding": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.Encoding": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "System.Collections": "4.3.0",
+ "System.Collections.Concurrent": "4.3.0",
+ "System.Linq": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.OpenSsl": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==",
+ "dependencies": {
+ "System.Collections": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Runtime.Numerics": "4.3.0",
+ "System.Security.Cryptography.Algorithms": "4.3.0",
+ "System.Security.Cryptography.Encoding": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.Primitives": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==",
+ "dependencies": {
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Threading": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.Security.Cryptography.X509Certificates": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "System.Collections": "4.3.0",
+ "System.Diagnostics.Debug": "4.3.0",
+ "System.Globalization": "4.3.0",
+ "System.Globalization.Calendars": "4.3.0",
+ "System.IO": "4.3.0",
+ "System.IO.FileSystem": "4.3.0",
+ "System.IO.FileSystem.Primitives": "4.3.0",
+ "System.Resources.ResourceManager": "4.3.0",
+ "System.Runtime": "4.3.0",
+ "System.Runtime.Extensions": "4.3.0",
+ "System.Runtime.Handles": "4.3.0",
+ "System.Runtime.InteropServices": "4.3.0",
+ "System.Runtime.Numerics": "4.3.0",
+ "System.Security.Cryptography.Algorithms": "4.3.0",
+ "System.Security.Cryptography.Cng": "4.3.0",
+ "System.Security.Cryptography.Csp": "4.3.0",
+ "System.Security.Cryptography.Encoding": "4.3.0",
+ "System.Security.Cryptography.OpenSsl": "4.3.0",
+ "System.Security.Cryptography.Primitives": "4.3.0",
+ "System.Text.Encoding": "4.3.0",
+ "System.Threading": "4.3.0",
+ "runtime.native.System": "4.3.0",
+ "runtime.native.System.Net.Http": "4.3.0",
+ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0"
+ }
+ },
+ "System.Security.Principal.Windows": {
+ "type": "Transitive",
+ "resolved": "4.5.0",
+ "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "2.0.0"
+ }
+ },
+ "System.ServiceModel.Primitives": {
+ "type": "Transitive",
+ "resolved": "4.5.3",
+ "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==",
+ "dependencies": {
+ "System.Private.ServiceModel": "4.5.3"
+ }
+ },
+ "System.Text.Encoding": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "System.Threading": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==",
+ "dependencies": {
+ "System.Runtime": "4.3.0",
+ "System.Threading.Tasks": "4.3.0"
+ }
+ },
+ "System.Threading.Tasks": {
+ "type": "Transitive",
+ "resolved": "4.3.0",
+ "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==",
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.1.0",
+ "Microsoft.NETCore.Targets": "1.1.0",
+ "System.Runtime": "4.3.0"
+ }
+ },
+ "entitydb.abstractions": {
+ "type": "Project",
+ "dependencies": {
+ "System.Linq.Async": "6.0.1"
+ }
+ },
+ "entitydb.common": {
+ "type": "Project",
+ "dependencies": {
+ "EntityDb.Abstractions": "1.0.0",
+ "System.Linq.Async": "6.0.1"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/EntityDb.InMemory/Sessions/IInMemorySession.cs b/src/EntityDb.InMemory/Sessions/IInMemorySession.cs
index 0beb47e9..874ce661 100644
--- a/src/EntityDb.InMemory/Sessions/IInMemorySession.cs
+++ b/src/EntityDb.InMemory/Sessions/IInMemorySession.cs
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
-using System.Collections.Generic;
-using System.Threading.Tasks;
namespace EntityDb.InMemory.Sessions;
diff --git a/src/EntityDb.InMemory/Sessions/InMemorySession.cs b/src/EntityDb.InMemory/Sessions/InMemorySession.cs
index f79d5bdf..ce19a751 100644
--- a/src/EntityDb.InMemory/Sessions/InMemorySession.cs
+++ b/src/EntityDb.InMemory/Sessions/InMemorySession.cs
@@ -1,8 +1,5 @@
using EntityDb.Abstractions.ValueObjects;
using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
namespace EntityDb.InMemory.Sessions;
diff --git a/src/EntityDb.InMemory/Sessions/ReadOnlyInMemorySession.cs b/src/EntityDb.InMemory/Sessions/ReadOnlyInMemorySession.cs
index 1811f4dc..5c39e06b 100644
--- a/src/EntityDb.InMemory/Sessions/ReadOnlyInMemorySession.cs
+++ b/src/EntityDb.InMemory/Sessions/ReadOnlyInMemorySession.cs
@@ -1,7 +1,5 @@
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Exceptions;
-using System.Collections.Generic;
-using System.Threading.Tasks;
namespace EntityDb.InMemory.Sessions;
diff --git a/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepository.cs b/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepository.cs
index c8c03b50..9c3c151e 100644
--- a/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepository.cs
+++ b/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepository.cs
@@ -2,8 +2,6 @@
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Disposables;
using EntityDb.InMemory.Sessions;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.InMemory.Snapshots;
diff --git a/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepositoryFactory.cs b/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepositoryFactory.cs
index 169d494e..38ea4924 100644
--- a/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepositoryFactory.cs
+++ b/src/EntityDb.InMemory/Snapshots/InMemorySnapshotRepositoryFactory.cs
@@ -3,9 +3,6 @@
using EntityDb.Common.Snapshots;
using EntityDb.InMemory.Sessions;
using Microsoft.Extensions.Options;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
namespace EntityDb.InMemory.Snapshots;
diff --git a/src/EntityDb.InMemory/packages.lock.json b/src/EntityDb.InMemory/packages.lock.json
index 8c9a5d5c..030ca5af 100644
--- a/src/EntityDb.InMemory/packages.lock.json
+++ b/src/EntityDb.InMemory/packages.lock.json
@@ -2,13 +2,31 @@
"version": 1,
"dependencies": {
"net6.0": {
+ "System.Linq.Async": {
+ "type": "Direct",
+ "requested": "[6.0.1, )",
+ "resolved": "6.0.1",
+ "contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
+ "dependencies": {
+ "Microsoft.Bcl.AsyncInterfaces": "6.0.0"
+ }
+ },
+ "Microsoft.Bcl.AsyncInterfaces": {
+ "type": "Transitive",
+ "resolved": "6.0.0",
+ "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
+ },
"entitydb.abstractions": {
- "type": "Project"
+ "type": "Project",
+ "dependencies": {
+ "System.Linq.Async": "6.0.1"
+ }
},
"entitydb.common": {
"type": "Project",
"dependencies": {
- "EntityDb.Abstractions": "1.0.0"
+ "EntityDb.Abstractions": "1.0.0",
+ "System.Linq.Async": "6.0.1"
}
}
}
diff --git a/src/EntityDb.Redis/Converters/EnvelopeHeadersConverter.cs b/src/EntityDb.Json/Converters/EnvelopeHeadersConverter.cs
similarity index 89%
rename from src/EntityDb.Redis/Converters/EnvelopeHeadersConverter.cs
rename to src/EntityDb.Json/Converters/EnvelopeHeadersConverter.cs
index 37b5b9c9..79fdc811 100644
--- a/src/EntityDb.Redis/Converters/EnvelopeHeadersConverter.cs
+++ b/src/EntityDb.Json/Converters/EnvelopeHeadersConverter.cs
@@ -1,51 +1,49 @@
-using EntityDb.Common.Envelopes;
-using System;
-using System.Collections.Generic;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace EntityDb.Redis.Converters;
-
-internal class EnvelopeHeadersConverter : JsonConverter
-{
- public override EnvelopeHeaders Read
- (
- ref Utf8JsonReader reader,
- Type typeToConvert,
- JsonSerializerOptions options
- )
- {
- var value = new Dictionary();
-
- while (reader.Read() && reader.TokenType == JsonTokenType.PropertyName)
- {
- var propertyName = reader.GetString()!;
-
- reader.Read();
-
- var propertyValue = reader.GetString()!;
-
- value.Add(propertyName, propertyValue);
- }
-
- return new EnvelopeHeaders(value);
- }
-
- public override void Write
- (
- Utf8JsonWriter writer,
- EnvelopeHeaders envelopeHeaders,
- JsonSerializerOptions options
- )
- {
- writer.WriteStartObject();
-
- foreach (var (propertyName, propertyValue) in envelopeHeaders.Value)
- {
- writer.WritePropertyName(propertyName);
- writer.WriteStringValue(propertyValue);
- }
-
- writer.WriteEndObject();
- }
-}
+using EntityDb.Common.Envelopes;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace EntityDb.Json.Converters;
+
+internal class EnvelopeHeadersConverter : JsonConverter
+{
+ public override EnvelopeHeaders Read
+ (
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options
+ )
+ {
+ var value = new Dictionary();
+
+ while (reader.Read() && reader.TokenType == JsonTokenType.PropertyName)
+ {
+ var propertyName = reader.GetString()!;
+
+ reader.Read();
+
+ var propertyValue = reader.GetString()!;
+
+ value.Add(propertyName, propertyValue);
+ }
+
+ return new EnvelopeHeaders(value);
+ }
+
+ public override void Write
+ (
+ Utf8JsonWriter writer,
+ EnvelopeHeaders envelopeHeaders,
+ JsonSerializerOptions options
+ )
+ {
+ writer.WriteStartObject();
+
+ foreach (var (propertyName, propertyValue) in envelopeHeaders.Value)
+ {
+ writer.WritePropertyName(propertyName);
+ writer.WriteStringValue(propertyValue);
+ }
+
+ writer.WriteEndObject();
+ }
+}
diff --git a/src/EntityDb.Redis/Converters/IdConverter.cs b/src/EntityDb.Json/Converters/IdConverter.cs
similarity index 89%
rename from src/EntityDb.Redis/Converters/IdConverter.cs
rename to src/EntityDb.Json/Converters/IdConverter.cs
index 197c18a9..2da79af2 100644
--- a/src/EntityDb.Redis/Converters/IdConverter.cs
+++ b/src/EntityDb.Json/Converters/IdConverter.cs
@@ -1,40 +1,39 @@
-using EntityDb.Abstractions.ValueObjects;
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace EntityDb.Redis.Converters;
-
-internal class IdConverter : JsonConverter
-{
- public override Id Read
- (
- ref Utf8JsonReader reader,
- Type typeToConvert,
- JsonSerializerOptions options
- )
- {
- if (reader.TokenType != JsonTokenType.String)
- {
- throw new NotSupportedException();
- }
-
- var stringValue = reader.GetString();
-
- var guidValue = Guid.Parse(stringValue!);
-
- return new Id(guidValue);
- }
-
- public override void Write
- (
- Utf8JsonWriter writer,
- Id id,
- JsonSerializerOptions options
- )
- {
- var stringValue = id.Value.ToString();
-
- writer.WriteStringValue(stringValue);
- }
-}
+using EntityDb.Abstractions.ValueObjects;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace EntityDb.Json.Converters;
+
+internal class IdConverter : JsonConverter
+{
+ public override Id Read
+ (
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options
+ )
+ {
+ if (reader.TokenType != JsonTokenType.String)
+ {
+ throw new NotSupportedException();
+ }
+
+ var stringValue = reader.GetString();
+
+ var guidValue = Guid.Parse(stringValue!);
+
+ return new Id(guidValue);
+ }
+
+ public override void Write
+ (
+ Utf8JsonWriter writer,
+ Id id,
+ JsonSerializerOptions options
+ )
+ {
+ var stringValue = id.Value.ToString();
+
+ writer.WriteStringValue(stringValue);
+ }
+}
diff --git a/src/EntityDb.Redis/Converters/VersionNumberConverter.cs b/src/EntityDb.Json/Converters/VersionNumberConverter.cs
similarity index 90%
rename from src/EntityDb.Redis/Converters/VersionNumberConverter.cs
rename to src/EntityDb.Json/Converters/VersionNumberConverter.cs
index 8c9a127e..c4d097f9 100644
--- a/src/EntityDb.Redis/Converters/VersionNumberConverter.cs
+++ b/src/EntityDb.Json/Converters/VersionNumberConverter.cs
@@ -1,38 +1,37 @@
-using EntityDb.Abstractions.ValueObjects;
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace EntityDb.Redis.Converters;
-
-internal class VersionNumberConverter : JsonConverter
-{
- public override VersionNumber Read
- (
- ref Utf8JsonReader reader,
- Type typeToConvert,
- JsonSerializerOptions options
- )
- {
- if (reader.TokenType != JsonTokenType.Number)
- {
- throw new NotSupportedException();
- }
-
- var ulongValue = reader.GetUInt64();
-
- return new VersionNumber(ulongValue);
- }
-
- public override void Write
- (
- Utf8JsonWriter writer,
- VersionNumber versionNumber,
- JsonSerializerOptions options
- )
- {
- var ulongValue = versionNumber.Value;
-
- writer.WriteNumberValue(ulongValue);
- }
-}
+using EntityDb.Abstractions.ValueObjects;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace EntityDb.Json.Converters;
+
+internal class VersionNumberConverter : JsonConverter
+{
+ public override VersionNumber Read
+ (
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options
+ )
+ {
+ if (reader.TokenType != JsonTokenType.Number)
+ {
+ throw new NotSupportedException();
+ }
+
+ var ulongValue = reader.GetUInt64();
+
+ return new VersionNumber(ulongValue);
+ }
+
+ public override void Write
+ (
+ Utf8JsonWriter writer,
+ VersionNumber versionNumber,
+ JsonSerializerOptions options
+ )
+ {
+ var ulongValue = versionNumber.Value;
+
+ writer.WriteNumberValue(ulongValue);
+ }
+}
diff --git a/src/EntityDb.Json/EntityDb.Json.csproj b/src/EntityDb.Json/EntityDb.Json.csproj
new file mode 100644
index 00000000..7445c17f
--- /dev/null
+++ b/src/EntityDb.Json/EntityDb.Json.csproj
@@ -0,0 +1,11 @@
+
+
+
+ false
+
+
+
+
+
+
+
diff --git a/src/EntityDb.Json/Envelopes/JsonBytesEnvelopeService.cs b/src/EntityDb.Json/Envelopes/JsonBytesEnvelopeService.cs
new file mode 100644
index 00000000..e0a6dcc5
--- /dev/null
+++ b/src/EntityDb.Json/Envelopes/JsonBytesEnvelopeService.cs
@@ -0,0 +1,24 @@
+using EntityDb.Common.Envelopes;
+using EntityDb.Common.TypeResolvers;
+using Microsoft.Extensions.Logging;
+using System.Text.Json;
+
+namespace EntityDb.Json.Envelopes;
+
+internal sealed class JsonBytesEnvelopeService : JsonEnvelopeService
+{
+ public JsonBytesEnvelopeService(ILogger logger, ITypeResolver typeResolver) : base(logger, typeResolver)
+ {
+ }
+
+ protected override Envelope DeserializeEnvelope(byte[] serializedData)
+ {
+ return (Envelope)JsonSerializer.Deserialize(serializedData, typeof(Envelope),
+ JsonSerializerOptions)!;
+ }
+
+ protected override byte[] SerializeEnvelope(Envelope envelope)
+ {
+ return JsonSerializer.SerializeToUtf8Bytes(envelope, typeof(Envelope), JsonSerializerOptions);
+ }
+}
diff --git a/src/EntityDb.Redis/Envelopes/JsonElementEnvelopeService.cs b/src/EntityDb.Json/Envelopes/JsonEnvelopeService.cs
similarity index 50%
rename from src/EntityDb.Redis/Envelopes/JsonElementEnvelopeService.cs
rename to src/EntityDb.Json/Envelopes/JsonEnvelopeService.cs
index 771224a7..f9a4a9e6 100644
--- a/src/EntityDb.Redis/Envelopes/JsonElementEnvelopeService.cs
+++ b/src/EntityDb.Json/Envelopes/JsonEnvelopeService.cs
@@ -1,104 +1,82 @@
-using EntityDb.Common.Envelopes;
-using EntityDb.Common.Exceptions;
-using EntityDb.Common.TypeResolvers;
-using EntityDb.Redis.Converters;
-using Microsoft.Extensions.Logging;
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace EntityDb.Redis.Envelopes;
-
-internal sealed class JsonElementEnvelopeService : IEnvelopeService
-{
- private static readonly JsonSerializerOptions JsonSerializerOptions = new()
- {
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
- };
-
- private readonly ILogger _logger;
- private readonly ITypeResolver _typeResolver;
-
- static JsonElementEnvelopeService()
- {
- JsonSerializerOptions.Converters.Add(new EnvelopeHeadersConverter());
- JsonSerializerOptions.Converters.Add(new IdConverter());
- JsonSerializerOptions.Converters.Add(new VersionNumberConverter());
- }
-
- public JsonElementEnvelopeService
- (
- ILogger logger,
- ITypeResolver typeResolver
- )
- {
- _logger = logger;
- _typeResolver = typeResolver;
- }
-
- public Envelope Deconstruct(TData data)
- {
- try
- {
- var dataType = data!.GetType();
-
- var json = JsonSerializer.Serialize(data, dataType, JsonSerializerOptions);
-
- var jsonElement = JsonSerializer.Deserialize(json, JsonSerializerOptions);
-
- var headers = EnvelopeHelper.GetEnvelopeHeaders(dataType);
-
- return new Envelope(headers, jsonElement);
- }
- catch (Exception exception)
- {
- _logger.LogError(exception, "Unable to deconstruct");
-
- throw new SerializeException();
- }
- }
-
- public byte[] Serialize(Envelope envelope)
- {
- try
- {
- return JsonSerializer.SerializeToUtf8Bytes(envelope, typeof(Envelope), JsonSerializerOptions);
- }
- catch (Exception exception)
- {
- _logger.LogError(exception, "Unable to serialize");
-
- throw new SerializeException();
- }
- }
-
- public Envelope Deserialize(byte[] rawData)
- {
- try
- {
- return (Envelope)JsonSerializer.Deserialize(rawData, typeof(Envelope),
- JsonSerializerOptions)!;
- }
- catch (Exception exception)
- {
- _logger.LogError(exception, "Unable to deserialize");
-
- throw new DeserializeException();
- }
- }
-
- public TData Reconstruct