Hi Sven;
Thanks for the more detailed explanation. Based on this info, I have some options that I can think of.
1. Functions can't be imported and used in LINQ but Stored Procedures can. So one suggestion is to rewrite your SQL Scalar Functions to SQL Stored Procs.
2. If you have to stick with Functions, consider re-writing your query such that it doesn't use projections. In other words, separate the query into 2 queries.
eg:
select value mye from MyEntity as mye where [the complex stuff across my database]
once you have your mye, then you can do this next call.
select dbo.MyFunction(mye.SomeField) as Rating from ...
I wish I could be more helpful. We have our Professional Services if you'd like to find out more about best practices in solving this kind of problems.
Edited by DenisK - 05-Jul-2011 at 12:55pm