Creating Object and setting properties using reflection

suggest change

Lets say we have a class Classy that has property Propertua

public class Classy
{
    public string Propertua {get; set;}
}

to set Propertua using reflection:

var typeOfClassy = typeof (Classy);
var classy = new Classy();
var prop = typeOfClassy.GetProperty("Propertua");
prop.SetValue(classy, "Value");

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents