Por que esse elenco genérico falha?
Eu tenho a seguinte herança:
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?
}
Não é possível converter o objeto do tipo 'System.Collections.Generic.List1[xRow]' to type 'System.Collections.Generic.IEnumerable
1 [TeraRow]
Além disso, por que preciso lançá-lo?