private void Find(JsonPathEvaluatorTabViewModel vm, object parameter) { try { var input = JToken.Parse(Source); var results = input.SelectTokens(Expression); Results = results.Select(x => x.ToString()); Message = Results.Any() ? "" : " Nothing found. "; } catch (Exception e) { Results = Enumerable.Empty <string>(); Message = $" Failed to search using the expression. {e.Message} "; } }
private bool CanFind(JsonPathEvaluatorTabViewModel vm, object parameter) { return(!string.IsNullOrWhiteSpace(vm.Source) && !string.IsNullOrWhiteSpace(vm.Expression)); }