The task is: A sequence of positive integer values integerList is given. Get sequence of string representations of only odd integerList values and sort in ascending order. This is my code:
public static IEnumerable<string> Task5(IEnumerable<int> integerList)
{
var result = from item in integerList
where item % 2 != 0
orderby item descending
select item;
return result.Cast<string>();
}
But I see this message every time, when try to start tests: System.InvalidCastException : Unable to cast object of type 'System.Int32' to type 'System.String'.