动态Linq - String.Split [英] Dynamic Linq - String.Split
本文介绍了动态Linq - String.Split的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
看来,LINQ的动态没有实现String.Split方法。
It appears that Dynamic Linq doesn't implement the String.Split method.
有没有办法实现与动态LINQ的?
Is there a way achieve the same results with Dynamic Linq ?
推荐答案
动态LINQ的不支持String.Split,也呼吁其他.NET类型的方法如下所示
Dynamic Linq does support String.Split and also calling other .net type methods as shown below
var query =
db.Customers.Where("City.Split(\"abc\".ToCharArray()).Length == 1 and Orders.Count >= @1", "London", 10).
OrderBy("CompanyName").
Select("New(CompanyName as Name, Phone)");
这是能够将字符串转换为表达式树但SQL没有任何字符串分割操作它会引发错误,如果你在SQL
It was able to convert the string to expression tree but as SQL doesn't have any string split operation it throws error if you run it on SQL
这篇关于动态Linq - String.Split的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文