标签: c# c#-4.0
我用C#编写了一个函数,参数类型未知。我如何阅读它,特别是如果它是字典?
public void GetData(object data) { // if data is a dictionary or object // if data is other type } var dict1 = new Dictionary<string, object>(); GetData(dict1); var obj = new Abc(); GetData(dict1);