Skip to main content

ToList() non disponible dans LINQ

Symptôme

Vous êtes en train de travailler sur une énumération à laquelle vous voulez appliquer la méthode (d'extension) ToList(). La méthode ToList() n'est pas reconnue.

Solution

Ajoutez un using:

using System.Linq;

et vérifiez que vous avez bien une référence sur System.Core.dll.

Quand est-ce que cela arrive?

Par exemple quand vous parcourez une propriété qui est un mapping one-to-many dans un modèle LINQ to SQL (*.dbml).

Comments

Popular posts from this blog

Learn Meteor book available

I'm pleased to announce the general release of my Learn Meteor book. It is now available as an ebook or print book from various sources: Learn Meteor print (paperback) on Lulu Learn Meteor ebook on LeanPub Learn Meteor ebook on Barnes & Noble Learn Meteor ebook on iBooks Learn Meteor ebook on Kobo Learn Meteor ebook on Scribd Learn Meteor ebook on Inktera Page Foundry Learn Meteor ebook on 24symbols Learn Meteor ebook on Amazon US Learn Meteor ebook on Amazon UK Learn Meteor ebook on Amazon France Learn Meteor ebook on Amazon Deutschland Learn Meteor ebook on Amazon Canada Learn Meteor ebook on Amazon India Learn Meteor ebook on Amazon Brasil Learn Meteor ebook on Amazon Mexico Learn Meteor ebook on Amazon España Learn Meteor ebook on Amazon Italia Learn Meteor ebook on Amazon Netherlands Learn Meteor ebook on Amazon Japan Learn Meteor ebook on Amazon Australia More sources are coming soon for the print version. Learn Meteor has been a fun experienc