3

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)

Omid.Hanjani
  • 1,444
  • 2
  • 20
  • 29

2 Answers2

4

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, e.g. Enumerable.Select(...).

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

Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129
3

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

thanks Jean and Matthew for your answers.

Omid.Hanjani
  • 1,444
  • 2
  • 20
  • 29
  • 1
    This is incorrect. `System.Linq.Enumerable` is a Type. It is a static class which resides in `System.Linq` namespace.So, namespace that should be imported is `System.Linq`. – decyclone Jan 11 '11 at 06:44
  • yes I know but when i try "import System.Linq from System.Core" this error returns: BCE0019: Boo.Lang.Compiler.CompilerError: 'ToList' is not a member of 'System.Linq.IQueryable`1[[...]]'. but when i use this type "import System.Linq.Enumerable from System.Core" the code works correctly – Omid.Hanjani Jan 12 '11 at 11:57