How do I declare a Delegate that holds a tuple?
I have a scenario where my methods can only accept 1 input parameter (Azure Durable Function Activity Trigger). To work around this, if I need multiple parameters, I stuff all my input values into a Tuple and then just pass the Tuple to the activity trigger.
Im trying to create a Tuple that holds 3 items
- Item1 = Dictionary<string,string>
- Item2 = Dictionary<string,string> MyFunction(T)
- Item3 = T
- Item 1 is a Dictionary<string,string>
- Item 2 is a Function that accepts a generic-typed object T, and outputs a Dictionary<string,string>
- Item 3 is a generic-typed object T
Id like to be able to execute Item2, using Item3 as input. The execution of Item2 would produce a Dictionary that I will combine with Item 1.
The issue I'm having is that the declaration syntax of a delegate doesn't really fit into a Tuple declaration syntax.
Here's how I attempted to type the Tuple with a delegate (which throws errors and does not work)
[FunctionName("MapOutputVariables")]
public Dictionary<string,string> MapOutputVariables<T>(
[ActivityTrigger] Tuple<Dictionary<string, string>, delegate Dictionary<string,string> map(T x), T> input,
ILogger log)
{ }
How would I go about correctly declaring the delegate within the tuple?
from Recent Questions - Stack Overflow https://ift.tt/33hTZ9c
https://ift.tt/eA8V8J
Comments
Post a Comment