I have a scenario where i want to search multiple values and with like. For example: If i have a sequence like
string[] codeValues={"Anthrax","anth","coliblex"};
And i want to search like '%Anthrax%' or "%anth%" or "%coliblex%". Currently i am having this code which only returns the values that will match with the exact search value.
string[] codeValues = {"anthrax"};
var obj=(from icdcodes in M_ICD_CPT_CODEs
where icdcodes.ROW_STATUS==1
&& icdcodes.FK_USER_ID==0
&& icdcodes.FK_CODE_TYPE_ID==240000
&& codeValues.Contains(icdcodes.CHAR255)
&& icdcodes.MODULE_PHYS_PREF==0
select new
{
PkId=icdcodes.PK_ICD_CPT_CODE_ID,
CodeValue=icdcodes.CODE_VALUE,
Narrative = icdcodes.CHAR255
}).ToList();
Console.Write(obj);
Is there any solution that will filter with like.
Equivalent sql will be
where CHAR255 LIKE '%anthrax%' or CHAR255 LIKE '%someothervalue%'..etc
Thanks