How to convert Object array to a Custom Class array?
<p>I have </p>

<pre><code>public class ABSInfo 
    {
        public decimal CodeCoveragePercentage { get; set; }
        public TestInfo TestInformation { get; set; }      

    }
</code></pre>

<p>And I have an Object array say "SourceType" </p>

<pre><code>public object[] SourceType { get; set; }
</code></pre>

<p>I want to convert the Object Array (SoiurceType) to ABSInfo[].</p>

<p>I am trying as </p>

<pre><code>ABSInfo[] absInfo = Array.ConvertAll(SourceType, x =&gt; (ABSInfo)x);
</code></pre>

<p>but error</p>

<p><strong>Unable to cast object of type 'WindowsFormsApplication1.TestInfo' to type 'WindowsFormsApplication1.ABSInfo'.</strong></p>

<p>how to do the conversion?</p>

<p><strong>Edited:</strong></p>

<pre><code>public class TestInfo
    {
        public int RunID { get; set; }
        public TestRunStatus Status { get; set; }
        public string Description { get; set; }
        public int TotalTestCases { get; set; }
        public int TotalTestCasesPassed { get; set; }
        public int TotalTestCasesFailed { get; set; }
        public int TotalTestCasesInconclusive { get; set; }
        public string ReportTo { get; set; }
        public string Modules { get; set; }
        public string CodeStream { get; set; }
        public int RetryCount { get; set; }
        public bool IsCodeCoverageRequired { get; set; }
        public FrameWorkVersion FrameworkVersion { get; set; }
        public string TimeTaken { get; set; }
        public int ProcessID { get; set; }
        public int GroupID { get; set; }
        public string GroupName { get; set; }
    }
</code></pre>
