This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some of UseUow and CorrelatingBy added to StoveComponentBase
- Loading branch information
1 parent
82d3f5b
commit 31de56b
Showing
5 changed files
with
141 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Runtime.CompilerServices; | ||
using System.Threading.Tasks; | ||
|
||
namespace Stove.Threading.Extensions | ||
{ | ||
/// <summary> | ||
/// Represents extensions on Tasks. | ||
/// </summary> | ||
public static class TaskExtensions | ||
{ | ||
/// <summary> | ||
/// ConfigureAwait(false) | ||
/// </summary> | ||
public static ConfiguredTaskAwaitable NotOnCapturedContext(this Task task) | ||
{ | ||
return task.ConfigureAwait(false); | ||
} | ||
|
||
/// <summary> | ||
/// ConfigureAwait(false) | ||
/// </summary> | ||
public static ConfiguredTaskAwaitable<T> NotOnCapturedContext<T>(this Task<T> task) | ||
{ | ||
return task.ConfigureAwait(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ public async Task UseUow_and_correlatingBy_should_work() | |
string correlationId = Guid.NewGuid().ToString(); | ||
The<IEventBus>().Register<UserCreatedEvent>((@event, headers) => | ||
{ | ||
headers[StoveConsts.Events.CorrelationId].ShouldBe(correlationId); | ||
headers[StoveConsts.Events.CausationId].ShouldBe(correlationId); | ||
}); | ||
|
||
await The<SomeDomainService>().CreateUserByCorrelating("oguzhan", "soykan", "[email protected]", correlationId); | ||
|