MicroLite 5.0.0 has been released on NuGet.
MicroLite 5.0 contains a number of changes and enhancements, many of which have been detailed in previous posts:
- MicroLite 5.0 – String Handling
- MicroLite 5.0 – New Features
- MicroLite 5.0 – Changes to Convention Mapping
- MicroLite 5.0 – Changes to Type Converters
- MicroLite 5.0 – Changes to Logging
- MicroLite 5.0 – Removal of methods from IListener
- MicroLite 5.0 – Reduced Mutability of SqlQuery
- MicroLite 5.0 – Removal of InsertOrUpdate
- MicroLite 5.0 – Changes to IdentifierStrategy
In addition to these, there are a number of internal changes to improve the performance of MicroLite and reduce its memory footprint.
Upgrading to 5.0
Firstly, if you didn’t use the new configuration method introduced in MicroLite 4.0.1 for configuring a connection, change to use it:
Configure.Fluently().ForMsSqlConnection("Connection").CreateSessionFactory(); Configure.Fluently().ForMySqlConnection("Connection").CreateSessionFactory(); Configure.Fluently().ForPostgreSqlConnection("Connection").CreateSessionFactory(); Configure.Fluently().ForSQLiteConnection("Connection").CreateSessionFactory();
SqlBuilder class has moved from
MicroLite.Builder so you will need to change any
using MicroLite.Query; statements to
using MicroLite.Builder; and any calls to
MicroLite.Builder.SqlBuilder if you have them fully qualified. A simple find and replace on “MicroLite.Query” to “MicroLite.Builder” should be sufficient.
Thirdly, the deprecated
Projection(SqlQuery) method on
ISession has been removed, use
Fetch<dynamic>(SqlQuery) instead as noted in MicroLite 4.0 – Changes to Projections and Dynamics.
The Wiki wiki page has also been improved with more details and examples – please check it out!