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 });
}
}
어떻게 캐스트 value할 수 paramType있습니까? valueA는 string, paramType아마 기본 유형처럼 될 것이다 int, string또는 어쩌면 float. 변환이 가능하지 않으면 예외를 던지는 것이 멋지다.