From 1f027dfcab096b509d73a9fd4912e4964b8d891a Mon Sep 17 00:00:00 2001 From: tangxuehua Date: Thu, 6 Aug 2020 22:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ENode.EQueue/ENode.EQueue.csproj | 4 ++-- src/ENode/ENode.csproj | 6 +++--- .../Eventing/DuplicateEventStreamException.cs | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 src/ENode/Eventing/DuplicateEventStreamException.cs diff --git a/src/ENode.EQueue/ENode.EQueue.csproj b/src/ENode.EQueue/ENode.EQueue.csproj index 82000ebf..b9bb35f4 100644 --- a/src/ENode.EQueue/ENode.EQueue.csproj +++ b/src/ENode.EQueue/ENode.EQueue.csproj @@ -2,8 +2,8 @@ netstandard2.0 - 2.1.7 - 2.1.7.0 + 2.1.8 + 2.1.8.0 diff --git a/src/ENode/ENode.csproj b/src/ENode/ENode.csproj index 4b0b56e0..6b399989 100644 --- a/src/ENode/ENode.csproj +++ b/src/ENode/ENode.csproj @@ -2,9 +2,9 @@ netstandard2.0 - 3.0.1 - 3.0.1.0 - 3.0.1.0 + 3.0.2 + 3.0.2.0 + 3.0.2.0 diff --git a/src/ENode/Eventing/DuplicateEventStreamException.cs b/src/ENode/Eventing/DuplicateEventStreamException.cs new file mode 100644 index 00000000..f23a61f1 --- /dev/null +++ b/src/ENode/Eventing/DuplicateEventStreamException.cs @@ -0,0 +1,18 @@ +using System; + +namespace ENode.Eventing +{ + public class DuplicateEventStreamException : Exception + { + private const string ExceptionMessage = "Aggregate root [type={0},id={1}] event stream already exist in the EventCommittingContextMailBox, eventStreamId: {2}"; + + public DomainEventStream DomainEventStream { get; set; } + + /// Parameterized constructor. + /// + public DuplicateEventStreamException(DomainEventStream domainEventStream) : base(string.Format(ExceptionMessage, domainEventStream.AggregateRootTypeName, domainEventStream.AggregateRootId, domainEventStream.Version)) + { + DomainEventStream = domainEventStream; + } + } +}