简体   繁体   中英

How can i use Extension Methods in boo

I have a list in my boo script and want to use System.Linq Extension Methods but boo compiler throw this Exception:

BCE0019: Boo.Lang.Compiler.CompilerError: 'ToList' is not a member of 
'System.Linq.IQueryable`1[[...]]'.

("..." is type of my object)

What version of Boo? Extension Methods have been supported since 0.9.0. If you can't use extension methods with the version you are using, you'll have to use absolute method calls, eg Enumerable.Select(...).

As @Jean has said, have you also imported System.Linq ?

I should import System.Linq.Enumerable not System.Linq

thanks Jean and Matthew for your answers.

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