C# ???dynamic??Dictionary????
???????????? ???????[ 2015/3/12 13:52:52 ] ????????C# ??????? .NET ????
??????????????????Σ???????? dynamic ???? Dictionary?????????Dictionary<string??object>????
????dynamic ????????????????? Dictionary???????????????????????????dynamic??
?????????????????????????????????????顣
??????????????2?????????
public void TestDynamic()
{
var e = CallDynamic(new { Value = 0 });
int v = e.Value;
}
public void TestDictionary()
{
var dict = new Dictionary<string?? object>();
dict["Value"] = 0;
dict = CallDictionary(dict);
int v = (int)dict["Value"];
}
private dynamic CallDynamic(dynamic test)
{
int v = test.Value;
v++;
return new { Value = v };
}
private Dictionary<string?? object> CallDictionary(
Dictionary<string?? object> test)
{
int v = (int)test["Value"];
v++;
var dict = new Dictionary<string?? object>();
dict["Value"] = v;
return dict;
}
????????????? 1?Ρ?10?Ρ?100?Ρ?1000?Ρ?1e4?Ρ?1e5?Ρ?1e6?? ???
?????????
????????dynamic?к?dynamic2?е??????????
????????????????????????? ?? ?????????????????????в???
????????????????????????????????
????1.dynamic??????????????????????
????2.???????????????????????????????dynamic???????????Dictionary
????3.????????????????dynamic????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11