Imagine an in-house application aimed at the very technical user. The app maintains data. There isn't a heck of a load of data, but there is enough to make some sort of a query mechanism necessary.
The application's UI is very simple. It basically allows the user to enter a query (as text), and shows the data matching that query.
Had the back-end of the app been an SQL database, the user could just type the body of the WHERE clause. The app wouldn't be particularly friendly, but it would be acceptable for this task.
However, the data is not in a database. It's accessible through an IEnumerable<>
.
Is there a reasonably easy way of getting similar functionality without writing a whole parser for a made-up query language? Ideally in the form of a free library, which provides something like the LINQ .Where<>
method, except that the method takes the textual query entered by the user?