We are trying to replace multiple character in property(string) that we query from database.
var list = _context.Users.Where(t => t.Enable).AsQueryable();
list = list.Where(t => t.Name.ToLower().Contains(searchValue));
Property Name should be without characters (.,-').
We have tried:
list = list.Where(t => t.Name.ToLower().Replace(".","").Replace(",","").Replace("-","").Contains(searchValue));
and it works like this, but we don't want to use replace multiple times.
Is there any other ways that works with IQueryable
? Thanks.