using System.Collections.Generic;
public static class ObjectExtensions
public static object GetPropertyValue(this object someObj, string propName)
PropertyInfo prop = someObj.GetType().GetProperty(propName);
return prop.GetValue(someObj, null);
public static void Main()
var lista = new List<MinhaClasse>()
Id = 1, Value = "Valor 1"
Id = 2, Value = "Valor 2"
var listaAnonima = lista.Select(x => new
listaAnonima.ForEach(HandlerAnonymous);
public static void HandlerAnonymous(object obj)
Console.WriteLine(obj.GetPropertyValue("Teste"));