【发布时间】:2015-08-07 20:35:10
【问题描述】:
我在 .NET 框架的很多地方都看到了这一点。不幸的是,我不记得其他的,但它们都在 Katana 源代码程序集中。
东西被放入一个元组并立即以相同的方法删除/读回。这对我来说没有任何意义。
我了解(并且还通过阅读 the Wikipedia entry 关于该主题并在多年前研究关系数据时了解了其含义)它的用途。只是这种特殊行为对我来说没有多大意义。
public AuthenticationResponseChallenge AuthenticationResponseChallenge
{
get
{
Tuple<string[], IDictionary<string, string>> challengeEntry = this.ChallengeEntry;
if (challengeEntry == null)
{
return null;
}
return new AuthenticationResponseChallenge(challengeEntry.Item1, new AuthenticationProperties(challengeEntry.Item2));
}
set
{
if (value == null)
{
this.ChallengeEntry = null;
return;
}
this.ChallengeEntry = Tuple.Create<string[], IDictionary<string, string>>(value.AuthenticationTypes, value.Properties.Dictionary);
}
}
更新
好的,抱歉,不好的例子。我已经工作太久了。我需要一个例子来说明我的观点。不幸的是,我从早上起就翻遍了很多东西,以至于我记不起来了,我会在有空的时候再回到这个。
【问题讨论】: