Search code examples
c#workflow-foundation-4

Convert an InArgument<T> into type T


I'm making a custom activity for a workflow, but am having trouble with InArguments. I have InArguments of type String that I want to use as Strings in the code, but I cannot find a way to do this conversion. I've searched online but couldn't find a solution.

I'm pretty sure I should be doing this inside the "get-set" when the variable is created but don't know how exactly to do this conversion.

Here is where I create the variable:

[Input("Job Name")]
[Default("BMS_ExtractTransformLoad")]
public InArgument<String> JobName { get; set; }

Thanks for any help!


Solution

  • You can get it this way.

    var jobName = JobName.Get(activityContext);