What you're describing isn't possible. In the case of your Linq to Sql query, the C# compiler creates an anonymous type with a single property named Foo with the same type as t.column. Type inferencing is then used and the variable "query" is actually strongly typed to this anonymous type (which is what gives you intellisense goodness on this variable).
Using "var" as a parameter type isn't possible because the type of the parameter can't be inferred, it requires the calling expression to decide on the actual type of the parameter.
The best that you could do would be to use generics and iterate through properties:
public static void Print<T>(T obj)
{
Type type = typeof(T);
PropertyInfo[] properties = type.GetProperties();
foreach(PropertyInfo pi in properties)
{
Console.WriteLine(pi.Name + ": " + pi.GetValue(obj, null));
}
}
which gives you a "rudimentary" ability to use anonymous types (or any type for that matter) as a parameter.