Je veux utiliser LINQ pour interroger un tableau 2D mais je reçois une erreur:LINQ avec tableau 2D, sélectionnez pas trouvé
codeCould not find an implementation of the query pattern for source type 'SimpleGame.ILandscape[,]'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?
suit:
var doors = from landscape in this.map select landscape;
J'ai vérifié que j'ai inclus la référence System.Core
et en utilisant System.Linq
.
Quelqu'un pourrait-il donner des causes possibles?
De plus, est-ce que this.map implémente IEnumerable/IQueryable? –
@Matthew Abbott: Eh bien, c'est un tableau 2D, donc je suppose que certaines personnes de Microsoft l'ont implémenté. – LLS
duplication possible de [Pourquoi les tableaux multidimensionnels C# n'implémentent-ils pas IEnumerable?] (Http://stackoverflow.com/questions/275073/why-does-c-multidimensional-arrays-not-implement-ienumerablet) –
ChrisF