The problem is that when using IQueryable provider tries to translate all LINQ expressions into something that it can send to the database. He does not know what to do with ToString("s") , so a NotSupported exception is NotSupported .
If you must add .AsEnumerable() before calling Select , then it should work. The difference is that the Person object will be fully loaded into memory, then the Select method will be launched, and all this will be executed as a compiled .NET method, and not as SQL. Thus, essentially, anything after AsEnumerable() will be executed in memory, and not in the database, so it is usually not recommended to do this until you trim the number of rows as much as possible (i.e., after all Where and OrderBy with )
source share