@Adiga's answer is quite incomplete and only covers some of the differences in usage.
However .StartsWith(...) , .Contains(...) and .EndsWith(...) also translate differently in SQL, then EF.Functions.Like .
For example, .StartsWith translates as (string LIKE pattern + "%" AND CHARINDEX(pattern, string) = 1) OR pattern = '' , where .Contains translates to (CHARINDEX(pattern, string) > 0) OR pattern = '' .
EF.Functions.Like however goes into string LIKE pattern [ESCAPE escapeChar] .
It may also have performance implications. The above is true for the EF Core SqlServer provider . Other EF Core vendors may translate it differently.
Tseng
source share