У меня есть такой статический метод:
public static string MyMethod(Func<Student, object> func)
{
return ??? ;
}
и я использую его следующим образом:
var s1 = MyMethod(student => student.ID); // Return "ID" ???
var s2 = MyMethod(student => student.Age); // Return "Age" ???
var s3 = MyMethod(student => student.Name); // Return "Name" ???
Как написать метод, возвращающий следующие результаты?
- s1 : "ID"
- s2: "Возраст"
- s3: "Имя"
* возвращать имя каждого свойства после => в виде строки
Expression<Func<Student, object>>
. - person Jon   schedule 13.12.2013