0

c# でリストから辞書を取得するために linq を使用したいのですが、このコードを使用します

List<Jointure> lj = table.jointures.GetJointures(Visibilites.Liste, false)
                        .ConvertAll(o => new Jointure(o, table.nom, tabloidConfig.config.tables[o.nomTable].corbeille));

jointures=new Dictionary<string,Jointure>(StringComparer.OrdinalIgnoreCase);

jointures = lj.ToDictionnary(o => o.nom, o => o);

ただし、次の例外がスローされます。

Erreur 109 'System.Collections.Generic.List' ne contient pas une definition pour 'ToDictionnary' et aucune method d'extension 'ToDictionnary' acceptant un premier argument de type 'System.Collections.Generic.List' n'a été trouvée ( ou une référence d'assembly est-elle manquante を使用した une ディレクティブ ?) D:\dev\Visual studio\Tanloid\Transport\base.aspx.cs 366 32 Tabloid

4

1 に答える 1

3

メソッド名のスペルが間違っています。 toDictionnaryする必要がありますToDictionary

于 2013-04-09T16:29:57.473 に答える