How can I pass anonymous types as parameters to other functions? Consider this example:
var query = from employee in employees select new { Name = employee.Name, Id = employee.Id };
LogEmployees(query);
The variable query
here doesn't have strong type. How should I define my LogEmployees
function to accept it?
public void LogEmployees (? list)
{
foreach (? item in list)
{
}
}
In other words, what should I use instead of ?
marks.