Quantcast
Channel: How to get a PropertyInfo without property name?
Browsing latest articles
Browse All 3 View Live

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 Article


How 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 Article


How 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
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>