For example I have
private void test(Action> fn)
{
fn((\"hello\", 10));
}
test(t =>
{
var (s, i) = t;
C
The closest that I could get.
public static class DeconstructExtensions
{
public static Action Deconstruct(this Action<(T1, T2)> action) => (a, b) => action((a, b));
public static Action<(T1, T2)> Construct(this Action action) => a => action(a.Item1, a.Item2);
}
class Test
{
private void fn((string, int) value) { }
private void test(Action> fn)
{
fn(("hello", 10));
}
private void Main()
{
var action = new Action((s, i) =>
{
Console.WriteLine(s);
Console.WriteLine(i);
});
test(action.Construct());
}
}