Hi Guys I have the code below but it give me an error at
.Where(p => Regex.Replace(p.Phone, rgPattern, "") == Regex.Replace(phone.Trim(), rgPattern, "")
string rgPattern = @"[\\\/:\*\?""<>|()-]";
var members = from m in Context.Members select m;
if (!String.IsNullOrEmpty(phone))
members = members.Where(p => Regex.Replace(p.Phone, rgPattern, "") == Regex.Replace(phone.Trim(), rgPattern, ""));
I know the LINQ commnand is not executed until I run:
members.OrderBy(orderBy).Skip(startRow).Take(maxRows).ToList();
Any idea in how to clean the value before comparing?