public JsonResult GetActors(string text) { var actors = _actorRepository.GetAllQueryable().Select(x => new ActorViewModel { Name = x.Name, RowId = x.RowId }); if (!string.IsNullOrEmpty(text)) { actors = actors.Where(x => x.Name.Contains(text)); } return(Json(actors, JsonRequestBehavior.AllowGet)); }