简体   繁体   中英

WP 7 - LINQ select statement from List<> error C#

I have problem with Linq statement. I want select some "MySong" from the List:

var filteredList = from s in list
                   where s.Title.Contains("test")
                   select s;

but I get this error:

'System.Collections.Generic.IEnumerable' does not contain a definition for 'System' and no extension method 'System' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Has someone solve this problem? Do you have tips how to select only songs, which contains for example "test"? thx for reply.

Add the following to the top of the code file:

using System.Linq;

And make sure the project has System.Core in the references.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM