public Task <OrderSagaData> FindBy(CompletePaymentTransaction message, SynchronizedStorageSession session, ReadOnlyContextBag context)
 {
     return(session.GetSagaData <OrderSagaData>(
                context: context,
                whereClause: "JSON_VALUE(Data,'$.PaymentTransactionId') = @propertyValue",
                appendParameters: (builder, append) =>
     {
         var parameter = builder();
         parameter.ParameterName = "propertyValue";
         parameter.Value = message.PaymentTransactionId;
         append(parameter);
     }));
 }
 public Task <MySagaData> FindBy(MyMessage message, SynchronizedStorageSession session, ReadOnlyContextBag context)
 {
     return(session.GetSagaData <MySagaData>(
                context: context,
                whereClause: "JSON_EXTRACT(Data,'$.PropertyPathInJson') = @propertyValue",
                appendParameters: (builder, append) =>
     {
         var parameter = builder();
         parameter.ParameterName = "propertyValue";
         parameter.Value = message.PropertyValue;
         append(parameter);
     }));
 }
            public Task <TestSaga.SagaData> FindBy(StartSagaMessage message, SynchronizedStorageSession session, ReadOnlyContextBag context)
            {
                Context.StartSagaFinderUsed = true;

                return(session.GetSagaData <TestSaga.SagaData>(
                           context: context,
                           whereClause: "json_value(Data,'$.Property') = @propertyValue",
                           appendParameters: (builder, append) =>
                {
                    var parameter = builder();
                    parameter.ParameterName = "propertyValue";
                    parameter.Value = "Test";
                    append(parameter);
                }));
            }
Ejemplo n.º 4
0
            public Task <TestSaga.SagaData> FindBy(SomeOtherMessage message, SynchronizedStorageSession session, ReadOnlyContextBag context, CancellationToken cancellationToken = default)
            {
                testContext.FinderUsed = true;

                return(session.GetSagaData <TestSaga.SagaData>(
                           context: context,
                           whereClause: @"""Data""->>'Property' ='Test'",
                           appendParameters: (builder, append) =>
                {
                    var parameter = builder();
                    parameter.ParameterName = "propertyValue";
                    parameter.Value = "Test";
                    append(parameter);
                }, cancellationToken));
            }