1

I have got a deserialization method which returns a ValueTuple<String[],String[],String[,],String[,],String[,]>:

var des = deserializeobject(filename); 

Now I would like to work with these arrays within the method

public static void oDocX(); 

How can I hand over the local variable des to the method oDocX?

ViRuSTriNiTy
  • 5,017
  • 2
  • 32
  • 58
Anne Martin
  • 69
  • 1
  • 10

1 Answers1

2

Either have a variable at class level:

class YourClass
{
    private static ValueTuple<String[],String[],String[,],String[,],String[,]> _des;

    // some methods

    public static void oDocX() {...}
}

and then assign it like this:

_des = deserializeobject(filename);

and use it like this in oDocX:

public static void oDocX()
{
    var x = _des;
}

Or take it as a parameter of oDocX:

public static void oDocX(ValueTuple<String[],String[],String[,],String[,],String[,]> des)
{
    var x = des;
}

And call the method like this:

var des = deserializeobject(filename);
oDocX(des);
croxy
  • 4,082
  • 9
  • 28
  • 46