I am trying to create a method that receives an anonymous type (see LINQ)
(Please correct me if the term tipo anônimo (anonymous types)
is incorrect)
MinhaLista (produtos.Select(p => new {p.Id, p.Estoque})
I asked Visual Studio to create the method automatically and it was generated: public static object MinhaLista (object @select)
I would like the method to be possible:
foreach (var produto in produtos)
{
Debug.WriteLine(produto.Id);
}
What is the correct way to define a method to receive this tipo anônimo (anonymous types)
?