The types you are using all implement IConvertible
. As such you can use ChangeType
.
value = Convert.ChangeType(method.Invoke(null, new[] { value }), paramType);
More Related Contents:
- How to get C# Enum description from value? [duplicate]
- How do you serialize a string as CDATA using XmlSerializer?
- Change default app.config at runtime
- Dynamically generate LINQ queries
- Call one constructor from another
- Should functions return null or an empty object?
- Compute the DateTime of an upcoming weekday
- List thread safety
- ToggleButton in C# WinForms
- process.start() arguments
- Accordion in Windows Forms DataGridView
- What replaces WCF in .Net Core?
- Using c++ library in c#
- Why does IEnumerator inherit from IDisposable while the non-generic IEnumerator does not?
- Hide form instead of closing when close button clicked
- Is there an equivalent to the Scanner class in C# for strings?
- In c# what does ‘where T : class’ mean?
- Why would one ever use the “in” parameter modifier in C#?
- linq group by contiguous blocks
- Get Cell Value from a DataTable in C#
- Reading an int that’s updated by Interlocked on other threads
- Can I have a variable number of generic parameters?
- Custom Brace formatting with Resharper
- Fluent NHibernate, working with interfaces
- Setting a proxy for Chrome Driver in Selenium
- C# SQL insert command
- Uninstall Custom Action Not Deleting Registry Key
- Updating UI in C# using Timer
- Using StreamReader to check if a file contains a string
- Accessing a property in one ViewModel from another