↧
How to get a PropertyInfo without property name?
Yes, infoof would be a great feature.But, in C# 3.0 expression trees can do the trick.Code Blockusing System;using System.Reflection;using System.Linq.Expressions;class Person{ public int Age { get;...
View ArticleHow to get a PropertyInfo without property name?
Not at the moment; you have to pass a string in. I believe the C# team are considering a proposal for the infoof operator so you'd be able to write something like: PropertyInfo prop = infoof(Person,...
View ArticleHow to get a PropertyInfo without property name?
Hi,We have a simple class 'Person' below. Code Blockpublic class Person{public string FirstName(){...}public int Age() {...}public string Address() {...}} We can get the name of the Person class at...
View Article