Version 5.0 release notes

Version 5.0 is a completely rewritten major update of EasyQuery which now can be used in any ASP.NET Core (version 2.0 and higher) project and with almost any frontend platform (MVC, Razor pages, Angular, React, Vue, etc).

There are a lot of changes both on the server-side part and in the client-side library (EasyQuery.JS). Below we will describe the most important ones:

Core library

1. JSON format

The base format for saving data models and queries is JSON. Old XML format is still supported but we advise to switch to JSON whenever it's possible since it's more compact and has faster saving/loading functions.

2. Simplified class structure

We remove unnecessary complexity whenever it's possible. For example instead of 6 classes which represented query conditions in version 4.4.2 (Condition, SimpleCondition, Predicate, DbCondition, DbSimpleCondition, DbPredicate), in version 5.0 we have only one Condition class which rules them all covers all cases where those old classes where used.

The similar situation we have with EqExpression class and its descendants. The number of "expression" classes has been cut in half.

ASP.NET Core middleware

Before version 5.0 EasyQuery required to set up a special controller (usually named EasyQueryController) which handled all AJAX requests from EasyQuery.JS widgets. Now all these requests are handled by a special EasyQuery middleware which has rich possibilities for customization and can cover all cases of using EasyQuery components.

For example, the most usual case for a modern ASP.NET Core applications when the model is loaded from some Entity Framework Core DbContext requires the following 3 lines now:

app.UseEasyQuery(options => {

So, now you don't need to copy/paste the controller's code from one of our samples and then modify its code for your case. You can find the examples of the middleware settings for different cases in our demo project, published on GitHub

Client-side scripts

The most radical changes were made in the JavaScript part of EasyQuery library. First of all, it was completely rewritten in TypeScript. Instead of one monolith script (eq.all.min.js) we split the client-side code onto several NPM packages which can be now used in any SPA application. The one script which rules them all contains everything is still available, of course, but it's more convenient now to use the separate packages, especially in TypeScript projects. The internal structure of the classes in a new library replicates the classes from the backend library. So, most of the EasyQuery concepts you used in your server-side applications (like "data model", "entity", "condition", "column", "expression", etc) are available on the client-side now as well.

In our demo project EqAspNetCoreDemo we show both approaches of including EasyQuery.JS scripts into your application:

  1. Via including one script available on our CDN. Look at AdvancedSearch.cshtml in our demo for example.
  2. By using NPM packages in your script. Here is an example of adhoc-reporting.ts script which is compiled with WebPack and then included to "Adhoc reporting" Razor view as a local JS file.

Additionally, in our samples GitHub repository we published an example of Angular project which uses EasyQuery scripts in a usual (for Angular) way - via NPM packages. Here you will get all the benefits of using TypeScript (intellisense, compile-time checking of types and parameters, etc) as a base language.

Upgrade instructions

If you want to update your project which uses version 4.x of EasyQuery for ASP.NET Core to version 5.0 - here are the upgrade instructions.