foreach (var filter in filters) { var filterType = typeof(Filters); var method = filterType.GetMethod(filter, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Static); if (method != null) { var parameters = method.GetParameters(); Type paramType = parameters[0].ParameterType; value = (string)method.Invoke(null, new[] { value }); } }
How do I make value before paramType ? value is a string , paramType is likely to be just a base type of type int , string or maybe float . I'm cool that he throws an exception if conversion is impossible.
c #
mpen Oct 24 2018-10-10 19:59
source share