void SetValue(PropertyInfo info, object instance, object value)
{
info.SetValue(instance, Convert.ChangeType(value, info.PropertyType));
}
More Related Contents:
- c# Creating an unknown generic type at runtime
- Casting vs using the ‘as’ keyword in the CLR
- Getting all types that implement an interface
- Type.GetType(“namespace.a.b.ClassName”) returns null
- How do I reflect over the members of dynamic object?
- How costly is .NET reflection?
- Select Right Generic Method with Reflection
- Reflection to Identify Extension Methods
- Shorter syntax for casting from a List to a List?
- C# Using Reflection to copy base class properties
- How to get the PropertyInfo of a specific property?
- Is there a way to set properties on struct instances using reflection?
- getting type T from IEnumerable
- Recursively Get Properties & Child Properties Of A Class
- How do I provide custom cast support for my class?
- Test if object implements interface
- Casting vs Converting an object toString, when object really is a string
- How do I create an instance from a string in C#?
- Dynamic Lang. Runtime vs Reflection
- How to hide public methods from IntelliSense
- How to find out if a property is an auto-implemented property with reflection?
- Why can’t Double be implicitly cast to Decimal
- What is the difference between casting and conversion? [duplicate]
- Create object instance of a class from its name in string variable
- Cast IList to List
- How can I get the values of the parameters of a calling method?
- How to set value of property where there is no setter
- using type returned by Type.GetType() in c#
- Reflecting a private field from a base class
- Two Types not equal that should be