diff --git a/Framework/src/Ncqrs/Eventing/EventServiceMappedByConvention.cs b/Framework/src/Ncqrs/Eventing/EventServiceMappedByConvention.cs new file mode 100644 index 00000000..cb482145 --- /dev/null +++ b/Framework/src/Ncqrs/Eventing/EventServiceMappedByConvention.cs @@ -0,0 +1,19 @@ +using System; +using Ncqrs.Domain; +using Ncqrs.Eventing.Sourcing; + +namespace Ncqrs.Eventing +{ + public abstract class EventServiceMappedByConvention : AggregateRootMappedByConvention + { + public void Raise(ISourcedEvent e) + { + var factory = NcqrsEnvironment.Get(); + var context = factory.CreateUnitOfWork(e.EventIdentifier); + + ApplyEvent(e); + + context.Accept(); + } + } +} \ No newline at end of file diff --git a/Framework/src/Ncqrs/Ncqrs.csproj b/Framework/src/Ncqrs/Ncqrs.csproj index 18f1a7a0..7c8ff752 100644 --- a/Framework/src/Ncqrs/Ncqrs.csproj +++ b/Framework/src/Ncqrs/Ncqrs.csproj @@ -125,6 +125,7 @@ +