2017-02-16 22:03:07 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Flow.Default
|
2017-02-12 18:04:26 +00:00
|
|
|
|
{
|
2017-02-16 22:03:07 +00:00
|
|
|
|
internal class StateYieldPoint : IExecutableYieldPoint
|
2017-02-12 18:04:26 +00:00
|
|
|
|
{
|
|
|
|
|
public bool StoreState { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public StateYieldPoint(bool storeState)
|
|
|
|
|
{
|
|
|
|
|
StoreState = storeState;
|
|
|
|
|
}
|
2017-02-16 22:03:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task Execute(FlowContext context)
|
|
|
|
|
{
|
|
|
|
|
if (StoreState)
|
|
|
|
|
await context.EnsureStored();
|
|
|
|
|
}
|
2017-02-12 18:04:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|