I'm developing an item list filter, and would like to filter by any term in the item record. I've seen this working on Angular, but I'm developing for ASP.NET MVC 5 and using the Entity Framework + Linq for queries.
Has anyone ever been through this?
Code that I am using to meet the demand:
List<Chamado> chamados = (from e in db.Chamado where e.StatusChamado != true select e).ToList();
if(filtro != null)
{
chamados = chamados.Where(s => s.Id.ToString().Contains(filtro)
|| s.Assunto.Contains(filtro)
|| s.Descricao.Contains(filtro)
|| s.ObraDestino.Descricao.Contains(filtro)
|| s.ResponsavelChamado.Nome.Contains(filtro)).ToList();
}
return chamados;