{%Pragmatic Coding%} Tips and tricks for software developers.

12Dec/120

How To: Get property value from string using reflection in C#

Few days ago I had to implement selection of a list of items with filtering and fields I had to filter by has been passed as a string value.
Will give you sample function where I have implemented filtering.

As you can see I'm using GetPropValue function that uses Reflection to get object property value.
Here is GetPropValue function implementation:

I hope this post was helpful for you!
Post a coment if you have any questions!

Share on social network

Share to Facebook
Share to Google Plus
Share to LiveJournal
Share to MyWorld
Share to Odnoklassniki
Share to Yandex
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.