I have never seen CTransliteration.Transliterate - do I correctly assume this comes from your own software / third-party library?
The Linq query that you target on the DataContext is converted to SQL and then executed on SQL Server. You wouldnβt have a way to express the query you want to run in SQL: CTransliteration.Transliterate is not part of the SQL language.
I think you can go in two ways: a) Divide the query into the part that runs on SQL Server and transliterate into .NET. For SELECT, you indicated that this is not a problem:
m_DataContext.Table .ToList() .Select(r => r.name=CTransliteration.Transliterate(r.Name));
For the WHERE clause, this makes a bad choice, since you will need to transfer everything to the application server and then filter.
b) Move the transliteration functionality to the CLR function in SQL Server and run the query through SQL, not Linq.
source share