I have a list of names which is static. I want to save it in a an static jaggedArray (to avoid multiple copies of same data).
I want to write something like below code
public static string[][] approverAndDelegatorList = new string[10][] [{"name1_1","name1_2"},{"name2_1","name2_2"},{"name3_1","name3_2"}....];
but C# is not allowing above code.
My current code is written as (given below), but for each call it is creatinga a new object
public static string[][] GetNameList()
{
string[][] nameList = new string[10][];
approverAndDelegatorList[0] = new string[] { "name1_1", "name1_2" };
approverAndDelegatorList[1] = new string[] { "name2_1", "name2_2" };
approverAndDelegatorList[2] = new string[] { "name3_1", "name3_2" };
............
return nameList;
}
In above method, the returned object is not static. Can you please help me to create static object. Thanks in advance