English 中文(简体)
同LINQ的条件一样
原标题:Like condition in LINQ

我比较新,不了解如何做类似情况。 我有一份我的目标清单,希望像我的目标那样做。 说明如帮助%。 我如何能够做到这一点? 增 编

最佳回答
问题回答

通常,你在问询之外使用同样的yn。

myObject.Description.StartsWith("Help")

这是否实际奏效,取决于您是否重新使用准则(它可能要么是作为法典,在这种情况下,一切都会奏效,要么被转换成像其他东西,例如可能具有局限性),但总是值得尝试。

you can use string.StartsWith or string.EndsWith or string.Contains property of string to use it as Like Operator.
Startswith will work for Like A%
Endswith will work for Like %A
Contains will work like %A%





相关问题
IEnumerable to array of parameter

Using linq? and XML is there a way to convert this IEnumerable to a string array of the value parameter? List<string> idList = new List<string>(); foreach (XElement idElement in word....

linq query for tag system - search for multiple tags

I have two tables, Tags(tagid, postid, tagname) and posts(postid, name, ...) now i want to make a query that returns me all posts that have a generic amount of tags. like: i want all posts that have ...

Linq operations against a List of Hashtables?

I m working with a set of legacy DAO code that returns an IList, where each Hashtable represents the row of a dynamically executed SQL query. For example, the List might contain the following records/...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

How to filter duplicate list items

i have list of items IList with data that looks list this: GenId TestMode 1 0 1 1 3 0 3 1 4 NULL 2 NULL i want to remove the index ...

C# Grouping/Sorting a Generic List<> using LINQ

Im looking to group and sort a Generic List<>. I have a list of objects representing files and each of these objects has a FileName, FileType and FileDate property. FileType is defined as an ...

热门标签