After encountering some problems with Massive today, I decided to create a simple test program to illustrate the problem. I wonder, what's the mistake I'm doing in this code:
var list = new List<string>
{
"Hey"
};
dynamic data = list.Select(x => x);
var count = data.Count();
The last line throws an error: 'object' does not contain a definition for 'Count'
Why is the "data" treated as an object? Does this problem occur because I'm calling an extension method?
The following code works:
var list = new List<string>
{
"Hey"
};
dynamic data = list.Select(x => x);
foreach (var s in data)
{
}
Why in this case "data" is correctly treated as IEnumerable?