.net - Convert a custom object array to System.Array in C# -
I have an array of custom objects in MyCustomArr []. I want to convert it to System.Array so that I can pass it in a method that only accepts System.Array. The signature of the method is:
public zero load (array 1, string paragraph 2) {}
No conversion is required for me as far as I know it. You can just go ahead and pass your array in the method. The following code works well:
MyClass [] myClassArray = new MyClass [2]; MyClassArray [0] = new MyClass (); MyClassArray [1] = New MyClass (); Weight (myClassArray, "some text");
Comments
Post a Comment