у меня
List<Attributes> la = new List<Attributes>();
la = (from t in result
let t1 = t.AttributeCollection
from t2 in t1
where t2.AttributeCode.Equals(attributeType)
let t3 = t2.TimeSeriesData
from k in t3.ToList()
where k.Key.Equals(startDate) && k.Key.Equals(endDate)
select new
{
AttributeCode = attributeType,
TimeSeriesData = fn(k.Key, k.Value.ToString())
}).ToList<Attributes>();
Я получаю ошибку:
'System.Collections.Generic.IEnumerable<AnonymousType#1>' does not contain a definition for 'ToList' and the best extension method overload 'System.Linq.Enumerable.ToList<TSource>(System.Collections.Generic.IEnumerable<TSource>)' has some invalid arguments
Я понял значение ошибки, но как печатать ее. Я использовал var, а затем перебрал его и получил результат. Но без этого каким-либо другим способом, которым я могу это сделать?
Использование C # 3.0
Спасибо