Linq2SQL expression solution that has no translation

Is there a way to provide translation for expressions that have no translation?

like double.parse ()

+2


source to share


1 answer


One option (with LINQ to SQL at least) is to write the functions you are missing as UDFs and add them to the data context; then you can use ctx.MyMethod(cust.SomeValue)

etc. in your LINQ query. Note that this can have performance implications if you want it to run it for every row in the table. Essentially your TSQL will include user.MyUdf(table.SomeValue)

etc.



+5


source







All Articles