Version 3.0 of EasyQuery introduces the most essential update of the library since its first release. You can find more information about the changes we made in this document. Here we introduce a step-by-step description what changes you need to do in your project to make it compatible with version 3.0 of EasyQuery.
Such assemblies as Korzh.WebControls.CLR40, Korzh.EasyQuery.CLR40 and Korzh.EasyQuery.WebControls.CLR40 should be removed from your project. Here we have indicated only the assemblies for WebForms (ASP.NET) edition of EasyQuery and for .NET 4.0 but you need to do the same for any other edition and version of .NET framework as well. Version 3.0 assemblies have different names (see the next step for details).
Again we suppose here that your project is for .NET 4.0 and WebForms edition of EasyQuery. Use similar assembly names for other editions and .NET versions. So you need to reference the following assemblies in your project: * Korzh.EasyQuery.NET40.dll * Korzh.EasyQuery.Db.NET40.dll * Korzh.EasyQuery.WebControls.NET40.dll
Since we have separated our core classes on two groups (the ones which represent the general query and data model objects and the classes which are designed to work with databases) you need to add Korzh.EasyQuery.Db namespace into the “using” section on the forms where EasyQuery controls are used:
using Korzh.EasyQuery.Db;
Additionally you may need to remove the deprecated namespace Korzh.WinControls.XControls
(in case it was used in your code).
Since Query
and DataModel
classes now represents some basic entities (not dealed to database) you need change the types of those object to DbQuery
and DbModel
correspondingly.
Additionally you will need to do similar changes for all data model and query objects as well, since some basic classes (like SimpleCondition or EntityAttrExpr) have become abstract so you can't create an instance of these classes anymore and need to use some their Db* descendants.
Moreover some classes which were the sub-classes before (like Query.Column
or DataModel.EntityAttr
) now become first-level classes (Column
or EntityAttr
correspondingly).
Here is the full map of necessary changes:
Since all SQL generation functionality in version 3.0 was moved into the special SqlQueryBuilder class, you can't call BuildSQL() method of the Query object to build the SQL or read it's Result property to get the generated statement. Instead of that you need to create an instance of SqlQueryBulider class and call its BuildSQL() method.
Example:
Was in version 2.x:
query.BuildSQL(); SqlTextBox.Text = query.Result.SQL;
Become in version 3.0:
SqlQueryBuilder builder = new SqlQueryBuilder(query); builder.BuildSQL(); SqlTextBox.Text = builder.Result.SQL;
Here is the map of the changes you may need to do:
That's all. Now your project must work well with EasyQuery 3.0!
Discussion