File tree Expand file tree Collapse file tree 4 files changed +29
-6
lines changed
Whaally.Domain.Infrastructure.OrleansHost/Grains
tests/Whaally.Domain.Tests/Scenarios Expand file tree Collapse file tree 4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 1- using FluentResults ;
1+ using System . Diagnostics ;
2+ using FluentResults ;
23using Microsoft . Extensions . Logging ;
34using Orleans . Concurrency ;
45using Orleans . EventSourcing ;
@@ -97,6 +98,11 @@ public async Task<IResultBase> Apply(IEventEnvelope eventEnvelope)
9798 return Result . Ok ( ) ;
9899 }
99100
101+ public Task Abort ( ActivityContext context )
102+ {
103+ throw new NotImplementedException ( ) ;
104+ }
105+
100106 [ ReadOnly ]
101107 public Task < TSnapshot > Snapshot < TSnapshot > ( ) where TSnapshot : ISnapshot
102108 {
Original file line number Diff line number Diff line change 1- using FluentResults ;
1+ using System . Diagnostics ;
2+ using FluentResults ;
23
34namespace Whaally . Domain . Abstractions ;
45
@@ -51,6 +52,13 @@ public Task<IResultBase> Apply(params IEvent[] events)
5152 => Apply ( new EventEnvelope (
5253 new EventMetadata ( ) ,
5354 events ) ) ;
55+
56+ /// <summary>
57+ /// Allows abortion of a running transaction based on the context it is part of
58+ /// </summary>
59+ /// <param name="context"></param>
60+ /// <returns></returns>
61+ public Task Abort ( ActivityContext context ) ;
5462
5563 public Task < TSnapshot > Snapshot < TSnapshot > ( )
5664 where TSnapshot : ISnapshot ;
Original file line number Diff line number Diff line change 1- using FluentResults ;
1+ using System . Diagnostics ;
2+ using FluentResults ;
23using Microsoft . Extensions . DependencyInjection ;
34using Whaally . Domain . Abstractions ;
45
@@ -150,6 +151,11 @@ public async Task<IResultBase> Apply(IEventEnvelope eventEnvelope)
150151 return Result . Ok ( ) ;
151152 }
152153
154+ public Task Abort ( ActivityContext context )
155+ {
156+ throw new NotImplementedException ( ) ;
157+ }
158+
153159 public Task < TSnapshot > Snapshot < TSnapshot > ( )
154160 where TSnapshot : ISnapshot =>
155161 Task . FromResult (
Original file line number Diff line number Diff line change 1+ using System . Diagnostics ;
12using FluentAssertions ;
23using FluentResults ;
34using Microsoft . Extensions . DependencyInjection ;
@@ -8,12 +9,12 @@ namespace Whaally.Domain.Tests.Scenarios;
89public class _0004__aggregate_interfaces
910{
1011 public interface ITestAggregate : IAggregate ;
11-
12+
1213 public class TestImplementation : ITestAggregate ;
1314
1415 // Commands
1516 public class TestCommand : ICommand ;
16-
17+
1718 public class TestCommandHandler : ICommandHandler < ITestAggregate , TestCommand >
1819 {
1920 public IResultBase Evaluate ( ICommandHandlerContext < ITestAggregate > context , TestCommand command )
@@ -40,6 +41,8 @@ public Task<IResult<IEventEnvelope[]>> Evaluate(params ICommandEnvelope[] comman
4041 => throw new NotImplementedException ( ) ;
4142 public Task < IResultBase > Apply ( params IEventEnvelope [ ] events )
4243 => throw new NotImplementedException ( ) ;
44+ public Task Abort ( ActivityContext context )
45+ => throw new NotImplementedException ( ) ;
4346 public Task < TSnapshot > Snapshot < TSnapshot > ( ) where TSnapshot : ISnapshot
4447 => throw new NotImplementedException ( ) ;
4548 }
@@ -90,4 +93,4 @@ public void CanCreateNewDefaultAggregateHandler()
9093 config . AggregateFactory = _ => new TestAggregateFactory ( ) ;
9194 } )
9295 . BuildServiceProvider ( ) , "" ) ;
93- }
96+ }
You can’t perform that action at this time.
0 commit comments