public ViewResult Index(string searchString) { IEnumerable <Rule> depto = departamentoService.GetAllDepartamento(); if (!String.IsNullOrEmpty(searchString)) { depto = depto.Where(o => o.Name.ToUpper().Contains(searchString.ToUpper())); } return(View(depto)); }