Here is a small solution written in c#
Use select(x => new {})... and type it as IEnumerable
private static void Main(string[] args)
{
var dirInfo = new DirectoryInfo(@"c:\windows\temp\");
IEnumerable<dynamic> qry = dirInfo.GetFiles("*.txt").Select(x => new { x.FullName, x.Extension });
foreach (var item in qry)
{
Console.WriteLine(string.Concat(item.Extension, " -> ", item.FullName));
}
Console.ReadKey();
}
Edit, here's a vb version
Private Shared Sub Main(args As String())
Dim dirInfo = New DirectoryInfo("c:\windows\temp\")
Dim qry As IEnumerable(Of dynamic) = dirInfo.GetFiles("*.txt").[Select](Function(x) New From { _
x.FullName, _
x.Extension _
})
For Each item As var In qry
Console.WriteLine(String.Concat(item.Extension, " -> ", item.FullName))
Next
Console.ReadKey()
End Sub
Update 2
Now as clearly stated in the question the typing is unclear, this can be solved by using IEnumerable. However this is not an optimal solution, instead I recommend to build an object and store your data there. But for minor applications I suppose it'll do.