3
I am developing an item list filter, and would like to filter by any term of the item record. I’ve seen this work in Angular, but I’m developing for ASP.NET MVC 5 and using the Entity Framework + Linq for queries.
Someone’s been through it?
Code I’m using to meet 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;
You need to post your code with the problem/doubt if it doesn’t get hard to help.
– DontVoteMeDown
You will use Angular in Views also?
– Leonel Sanches da Silva
I will post the code yes @Dontvotemedown
– Anderson Souza
@Ciganomorrisonmendez, at first I will not use Angular
– Anderson Souza
See if this helps you: http://answall.com/a/60613/20615
– Randrade
Thank you @Randrade!
– Anderson Souza