I have the following inheritance:
internal abstract class TeraRow{}
internal class xRow : TeraRow {} // xRow is a child of TeraRow
public IEnumerable<TeraRow> Compare(MappedTables which, DateTime selectionStart
, DateTime selectionEnd, string pwd)
{
IEnumerable<xRow> result=CompareX();
return (IEnumerable<TeraRow>)result; //Invalid Cast Exception?
}
Unable to cast object of type 'System.Collections.Generic.List1[xRow]' to type 'System.Collections.Generic.IEnumerable
1[TeraRow]
Also why do I need to cast it at all?