Assign array to class members in order
<p>I have the following class</p>

<pre><code>public class MyClass
{
  public string a {get;set;}
  public string b {get;set;}
  public string c {get;set;}
  public string d {get;set;}
  public string e {get;set;}
  ...
  ...
  public string z {get;set;}
}
</code></pre>

<p>and the following string array</p>

<pre><code>string[] input;
</code></pre>

<p>I have no way of knowing beforehand the size of the array. The only information I have is that it will be between 1 to 26 in length and all the items are in order. What I need to do is assign the array items in order to the class members as shown below.</p>

<pre><code>var myvar = new MyClass();

if(input.length &gt;= 1)
   myvar.a = input[0];
if(input.length &gt;= 2)
   myvar.b = input[1];
...
if(input &gt;=26)
   myvar.z = input[25];
</code></pre>

<p>Is there any way to do it more elegantly than my method?</p>
