Esempio n. 1
0
 /// <summary>
 /// Sets the workflow instance Id to process.
 /// </summary>
 /// <param name="data">The envelope to add the value to.</param>
 /// <param name="propertyBagFactory">The property bag factory.</param>
 /// <param name="workflowInstanceId">The workflow instance id.</param>
 public static void SetWorkflowInstanceId(
     this WorkflowMessageEnvelope data,
     IPropertyBagFactory propertyBagFactory,
     string workflowInstanceId)
 {
     data.Properties = propertyBagFactory.CreateModified(
         data.Properties,
         new KeyValuePair <string, object>[] { new KeyValuePair <string, object>("WorkflowInstanceId", workflowInstanceId) },
         null);
 }
Esempio n. 2
0
 /// <summary>
 /// Sets the workflow instances page number.
 /// </summary>
 /// <param name="data">The envelope to add the value to.</param>
 /// <param name="propertyBagFactory">The property bag factory.</param>
 /// <param name="pageNumber">The page number.</param>
 public static void SetWorkflowInstancesPageNumber(
     this WorkflowMessageEnvelope data,
     IPropertyBagFactory propertyBagFactory,
     int pageNumber)
 {
     data.Properties = propertyBagFactory.CreateModified(
         data.Properties,
         new KeyValuePair <string, object>[] { new KeyValuePair <string, object>("GetWorkflowInstancesPageNumber", pageNumber) },
         null);
 }
 /// <summary>
 /// Creates a new <see cref="IPropertyBag"/> based on an existing bag, but with some
 /// properties either added, updated, or removed, using a callback that produces a
 /// collection of key pair values to describe the properties to add or change.
 /// </summary>
 /// <param name="propertyBagFactory">The property bag factory.</param>
 /// <param name="input">The property bag on which to base the new one.</param>
 /// <param name="builder">A function that builds the collection describing the properties to add.</param>
 /// <param name="propertiesToRemove">Optional list of properties to remove.</param>
 /// <returns>A collection of key pair values.</returns>
 /// <remarks>
 /// <para>
 /// Similar to
 /// <see cref="Create(IPropertyBagFactory, Func{IEnumerable{KeyValuePair{string, object}}, IEnumerable{KeyValuePair{string, object}}})"/>,
 /// this supports property builders designed to be chained together. Whereas that method
 /// is for creating a new property bag from scratch, this invokes
 /// <see cref="IPropertyBagFactory.CreateModified(IPropertyBag, IEnumerable{KeyValuePair{string, object}}?, IEnumerable{string}?)"/>.
 /// For example:
 /// </para>
 /// <code><![CDATA[
 /// IPropertyBag childProperties = propertyBagFactory.CreateModified(
 ///     existingPropertyBag,
 ///     values => values.AddBlobStorageConfiguration(ContainerDefinition, tenancyStorageConfiguration));
 /// ]]></code>
 /// </remarks>
 public static IPropertyBag CreateModified(
     this IPropertyBagFactory propertyBagFactory,
     IPropertyBag input,
     Func <IEnumerable <KeyValuePair <string, object> >, IEnumerable <KeyValuePair <string, object> > > builder,
     IEnumerable <string>?propertiesToRemove = null)
 {
     return(propertyBagFactory.CreateModified(
                input,
                builder(PropertyBagValues.Empty),
                propertiesToRemove));
 }