How can I use extension methods in boo

I have a list in my boo script and you want to use System.Linq Extension Methods, but the boo compiler has thrown this exception:

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

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

+3
source share
2 answers

I need to import System.Linq.Enumerable not System.Linq

Thanks to Jean and Matthew for your answers.

+4
source

What version of Boo? Extension methods are supported since 0.9.0. If you cannot use extension methods with the version you are using, you will have to use absolute method calls, for example. Enumerable.Select (...).

As @Jean said, did you also import System.Linq?

+4
source

Source: https://habr.com/ru/post/1784250/


All Articles