1
0
mirror of synced 2024-11-16 06:43:51 +00:00

Somewhere along the line the recent changes got lost. Fixed it, I hope.

This commit is contained in:
Mark van Renswoude 2016-12-13 22:01:43 +01:00
parent 5871c8b7f0
commit 2806e2d304
5 changed files with 31 additions and 13 deletions

View File

@ -4,8 +4,8 @@ namespace Tapeti.Saga
{
public interface ISagaProvider
{
Task<ISaga<T>> Begin<T>() where T : class;
Task<ISaga<T>> Begin<T>(T initialState) where T : class;
Task<ISaga<T>> Continue<T>(string sagaId) where T : class;
Task<ISaga<T>> Current<T>() where T : class;
Task<object> Continue(string sagaId);
}
}

View File

@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tapeti.Saga</RootNamespace>
<AssemblyName>Tapeti.Saga</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -44,6 +45,17 @@
<Compile Include="ISagaProvider.cs" />
<Compile Include="ISagaStore.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SagaBindingMiddleware.cs" />
<Compile Include="SagaMemoryStore.cs" />
<Compile Include="SagaMessageMiddleware.cs" />
<Compile Include="SagaMiddleware.cs" />
<Compile Include="SagaProvider.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tapeti.csproj">
<Project>{8ab4fd33-4aaa-465c-8579-9db3f3b23813}</Project>
<Name>Tapeti</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -18,8 +18,10 @@ namespace Test
//[StaticQueue("test")]
public PoloMessage Marco(MarcoMessage message)
public PoloMessage Marco(MarcoMessage message, Visualizer visualizer)
{
visualizer.VisualizeMarco();
/*
using (sagaProvider.Begin<MarcoState>(new MarcoState
{
@ -60,9 +62,9 @@ namespace Test
}
*/
public void Polo(PoloMessage message)
public void Polo(PoloMessage message, Visualizer visualizer)
{
Console.WriteLine("Polo!");
visualizer.VisualizePolo();
}
}

View File

@ -1,6 +1,7 @@
using System;
using SimpleInjector;
using Tapeti;
using Tapeti.Saga;
using Tapeti.SimpleInjector;
namespace Test
@ -11,17 +12,15 @@ namespace Test
{
var container = new Container();
container.Register<MarcoEmitter>();
container.Register<Visualizer>();
container.Register<ISagaStore, SagaMemoryStore>();
var topology = new TapetiTopologyBuilder()
var config = new TapetiConfig("test", new SimpleInjectorDependencyResolver(container))
.Use(new SagaMiddleware())
.RegisterAllControllers()
.Build();
using (var connection = new TapetiConnectionBuilder()
.SetExchange("test")
.SetDependencyResolver(new SimpleInjectorDependencyResolver(container))
.SetTopology(topology)
.Build())
using (var connection = new TapetiConnection(config))
{
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();

View File

@ -52,6 +52,7 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MarcoController.cs" />
<Compile Include="Visualizer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
@ -62,6 +63,10 @@
<Project>{8ab4fd33-4aaa-465c-8579-9db3f3b23813}</Project>
<Name>Tapeti</Name>
</ProjectReference>
<ProjectReference Include="..\Tapeti.Saga\Tapeti.Saga.csproj">
<Project>{f84ad920-d5a1-455d-aed5-2542b3a47b85}</Project>
<Name>Tapeti.Saga</Name>
</ProjectReference>
<ProjectReference Include="..\Tapeti.SimpleInjector\Tapeti.SimpleInjector.csproj">
<Project>{d7ec6f86-eb3b-49c3-8fe7-6e8c1bb413a6}</Project>
<Name>Tapeti.SimpleInjector</Name>