简体   繁体   中英

Solution for Linq2SQL expressions that has no translation

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

like double.parse()

One option (with LINQ-to-SQL at least) is to write the functionality you are missing as a UDF and add it to the data-context; then you can use ctx.MyMethod(cust.SomeValue) etc in your LINQ query. Note that this may have performance implications if you are wanting it to run it for every row in the table. Essentially your TSQL will involve user.MyUdf(table.SomeValue) , etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM