相关疑难解决方法(0)

如何在Linq中使用SQL Like%?

我在SQL中有一个程序,我试图变成Linq:

SELECT O.Id, O.Name as Organization
FROM Organizations O
JOIN OrganizationsHierarchy OH ON O.Id=OH.OrganizationsId
where OH.Hierarchy like '%/12/%'
Run Code Online (Sandbox Code Playgroud)

我最关心的是:

where OH.Hierarchy like '%/12/%'
Run Code Online (Sandbox Code Playgroud)

我有一个存储层的列,例如/ 1/3/12,所以我只使用%/ 12 /%来搜索它.

我的问题是,Linq或.NET相当于使用百分号?

.net t-sql linq linq-to-entities sql-like

376
推荐指数
7
解决办法
37万
查看次数

通配符搜索LINQ

我想知道是否可以使用LINQ进行通配符搜索.

我看到LINQ有Contains,StartsWith,EndsWith等.

如果我需要像%Test这样的%if%work%,我该怎么办?

问候

c# sql linq wildcard

37
推荐指数
5
解决办法
5万
查看次数

标签 统计

linq ×2

.net ×1

c# ×1

linq-to-entities ×1

sql ×1

sql-like ×1

t-sql ×1

wildcard ×1