Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var propertyName = personType.GetProperty("Name");
- object nameValue = propertyName.GetValue(instance); // GetValue
- Console.WriteLine(nameValue);
- propertyName.SetValue(instance, "Ivo Petrov"); // SetValue
- newNameValue = propertyName.GetValue(instance);
- Console.WriteLine(nameValue);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement