Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15539

VS 2019 Reflection simple question

$
0
0
Hello Friends, :wave:

How could I retrieve the name of the property that I'm calling from a Func?

Here is my example class:

Code:

    Public Class MyObject
        Public Property Name As String
        Public Property Age As Integer
        Public Property Score As Integer
    End Class

and here is my Func:

Code:

        Dim myFunc As Func(Of MyObject, Integer) = Function(x) x.Age
How to get the "Age" property from myFunc? is it possible?

Thank you!

Viewing all articles
Browse latest Browse all 15539

Trending Articles



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