Adding search to linq query

I have a basic datatable, it can be completely general for this example, except that it contains a column Username.

I would like to have a simple text box and a button that searches for similarities in the box Username. I know that I can use the method .Contains()and it will be translated to LIKEin sql, but is this the right way to do this?

Secondly, suppose I have another element in many respects that I also want to look for, in this case Label.

Data
{
   ID,
   Name,
   ...
}

Many
{ 
  DataID,
  OtherID
}

Other
{
   ID,
   Label
}

Ultimately, I would like to find all Data elements with a label similar to some search suggestions. I just use again.

, Username Label ; { }?

: LIKE? , vs, ? , , . , LIKE-, , LIKE , db. , ?

+3

Source: https://habr.com/ru/post/1768744/


All Articles