Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Type dynamic along with Variables

$
0
0

I wanted to achieve following requirement not by using reflection 

class Customer
{

  public string Name {get;set;}

  public void Show()
  {
  }
}

Main Program
-------------
string propName = "Name"
string functionName  ="Show"

dynamic person = new Customer();
person.propName = "Some Value"
person.functionName()

How do i achieve it ?




K K Sanghi


Viewing all articles
Browse latest Browse all 31927

Trending Articles



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