0
ConcurrentDictionaryオブジェクトはConcurrentDictionary<int, DirtyFlag><int, DirtyFlag>
と定義されています。ここでdirtyフラグはDirty/Clean値を持つEnumです。ConcurrentDictionaryに拡張メソッドを書くには
私はDirtyオブジェクトだけを取得する拡張メソッドを作成しようとしています。 DirtyFlagがDirtyに設定されているオブジェクト。
私はこれを使用してみましたが、それは私にエラーを与える:
public static ConcurrentDictionary<int, DirtyFlag> GetDirtyRoutes(this ConcurrentDictionary<int, DirtyFlag> wholeDictionary)
{
return wholeDictionary.SelectMany(a => a.Value == DirtyFlag.Dirty);
}
は、これは私が取得していますエラーメッセージです:
The type arguments for method 'System.Linq.Enumerable.SelectMany<TSource,TResult>
(System.Collections.Generic.IEnumerable<TSource>,
System.Func<TSource,System.Collections.Generic.IEnumerable<TResult>>)' cannot
be inferred from the usage. Try specifying the type arguments explicitly.
任意のヘルプ?
あなたはこのリンク http://codereview.stackexchange.com/questions/2025/extension-methods-to-make-concurrentdictionary-getoradd-and-addorupdate-であなたの質問への答えを得ることができますスレッドsa –