2017-02-07 15:13:33 +00:00
|
|
|
|
using System.Collections.Generic;
|
2017-01-31 11:01:08 +00:00
|
|
|
|
using Tapeti.Config;
|
|
|
|
|
using Tapeti.Flow.Default;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Flow
|
|
|
|
|
{
|
|
|
|
|
public class FlowMiddleware : IMiddlewareBundle
|
|
|
|
|
{
|
|
|
|
|
public IEnumerable<object> GetContents(IDependencyResolver dependencyResolver)
|
|
|
|
|
{
|
|
|
|
|
var container = dependencyResolver as IDependencyContainer;
|
2017-02-05 22:22:34 +00:00
|
|
|
|
|
|
|
|
|
// ReSharper disable once InvertIf
|
2017-01-31 11:01:08 +00:00
|
|
|
|
if (container != null)
|
|
|
|
|
{
|
|
|
|
|
container.RegisterDefault<IFlowProvider, FlowProvider>();
|
|
|
|
|
container.RegisterDefault<IFlowHandler, FlowProvider>();
|
|
|
|
|
container.RegisterDefault<IFlowRepository, NonPersistentFlowRepository>();
|
2017-02-05 22:22:34 +00:00
|
|
|
|
container.RegisterDefault<IFlowStore, FlowStore>();
|
2017-01-31 11:01:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new[] { new FlowBindingMiddleware() };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|