Created
May 24, 2017 01:06
-
-
Save luodaoyi/08198c5e057c23f5dc44e92ab507e931 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
Dictionary<string, object> temp = new Dictionary<string, object>(); | |
temp.Add("Name", "金朝钱"); | |
temp["Age"] = 31; | |
temp["Birthday"] = DateTime.Now; | |
dynamic obj = new System.Dynamic.ExpandoObject(); | |
foreach (KeyValuePair<string, object> item in temp) | |
{ | |
((IDictionary<string, object>)obj).Add(item.Key, item.Value); | |
} | |
Console.WriteLine(string.Format("Name:{0}", obj.GetType().GetProperty("name").GetValue(obj, null).ToString())); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment