Query<T> Class
Represents a compiled query that can be evaluated against objects.
public sealed class Query<T>Type parameters
T- The type of object to query against.
Example
var queryBuilder = new QueryBuilder<Person>();
queryBuilder.AddHandler<string>("name", (obj, value) => obj.FullName.Contains(value, StringComparison.OrdinalIgnoreCase));
var query = queryBuilder.Build("name:john");
Assert.True(query.Evaluate(new Person("John Doe", new DateTime(2000, 1, 1))));Properties
| Name | Description |
|---|---|
| Diagnostics | Gets the problems found in the query, such as unbalanced parentheses or unknown keys, in the order they appear in it. |
| Text | Gets the original query text. |
Diagnostics
Query`1.csGets the problems found in the query, such as unbalanced parentheses or unknown keys, in the order they appear in it.
public IReadOnlyList<QueryDiagnostic> Diagnostics { get; }Property value
IReadOnlyList<QueryDiagnostic>
Remarks
The query is still evaluated: the parts the diagnostics report are read leniently, mostly as text.
Text
Query`1.csMethods
| Name | Description |
|---|---|
| Evaluate(T) | Evaluates the query against an object. |