Is there a way in C# where I can use reflection to set an object property?
Ex:
MyObject obj = new MyObject(); obj.Name = \"Value\";
You can also do:
Type type = target.GetType(); PropertyInfo prop = type.GetProperty("propertyName"); prop.SetValue (target, propertyValue, null);
where target is the object that will have its property set.