我在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相当于使用百分号?
我想知道是否可以使用LINQ进行通配符搜索.
我看到LINQ有Contains,StartsWith,EndsWith等.
如果我需要像%Test这样的%if%work%,我该怎么办?
问候