Assume a method declared as the following:
public static string GetString<T>(IEnumerable<T> collection, string theProperty)
How can I, using reflection, return the value of property theProperty of the first element in the generic collection? (using Linq’s First() method).
Thanks
Error checking omitted for brevity: