我需要从字符串中的数据类型列表创建元组,但没有得到任何解决方案。
这是我想要做的示例。
string[] dataType = {"int", "float", "datetime"};
//I want to create list like this but dynamically datatype come from db.
//List<Tuple<int, string, string>> list = new List<Tuple<int, string, string>>();
List<Tuple<dataType[0],dataType[1], dataType[2]>> list = new List<Tuple<dataType[0],dataType[1], dataType[2]>>();
//Here datatype value is in string so I want to convert string to actual datatype.
Run Code Online (Sandbox Code Playgroud)
或者,如果对此有任何替代解决方案,请指导我。