MicroLite 6.0 RC

The release candidate for MicroLite 6.0.0 has been released on NuGet, please feel free to download it and try it out.

This contains fixes for 3 bugs I found in beta 2 whilst running some integration tests with each of the supported database servers.

The RC build will be re-released as the final 6.0.0 build unless any further defects are uncovered, I expect to publish the final release some time before the end of November 2014.

If you find any bugs, please raise them in the GitHub Issues along with any necessary information to reproduce it (or better yet, a pull request with a failing unit test) and we’ll make sure it’s squashed before the final release.

MicroLite 6.0 Beta 2

A second beta for MicroLite 6.0.0 has been released on NuGet, please feel free to download it and try it out.

This contains a fix for a bug I found in the previous beta whilst updating some of the extensions to work with the new async methods.

There are some breaking changes in MicroLite 6.0 which make them incompatible with some functionality in the current versions of the Mvc extension (5.3.0) and WebApi extension (4.3.0). The extensions will be updated alongside MicroLite 6.0 when the final build is released but at this point in time, there are no beta builds for the extensions.

Remember, this is a beta so use it for testing only, not production code!

If you find any bugs, please raise them in the GitHub Issues along with any necessary information to reproduce it (or better yet, a pull request with a failing unit test) and we’ll make sure it’s squashed before the final release.

MicroLite 6.0 Beta

A beta for MicroLite 6.0.0 has been released on NuGet, please feel free to download it and try it out.

We will cover the changes in a series of blog posts, but here are the main things to be aware of:

  • Support for async/await in the session API in the .NET 4.5 build
  • Attribute mapping has moved namespace to MicroLite.Mapping.Attributes
  • DbEncryptedString has been moved into its own MicroLite.Extensions.Cryptography project and package – this will be published along side the final MicroLite 6.0 build
  • Support for specifying the DbType of a property
  • Support for dynamic connection strings (in addition to named connection strings)
  • Updates to the Delete and Update SqlBuilders to make them more on par with the Select builder
  • Improved logging and debugging support
  • Removed methods marked as obsolete in MicroLite 5.0-5.3

Unfortunately, we have not had time to finish the Oracle and Sybase implementations so they won’t be included in 6.0, they will have to wait for MicroLite 6.1.

Remember, this is a beta so use it for testing only, not production code!

If you find any bugs, please raise them in the GitHub Issues along with any necessary information to reproduce it (or better yet, a pull request with a failing unit test) and we’ll make sure it’s squashed before the final release.

MicroLite what’s coming after 5.3?

There are 2 major things we currently want to do.

Firstly, add support for Oracle and Sybase which should pretty much cover all the major database providers.

We currently support (as of MicroLite 5.3):

  • MS SQL 2005/2008/2012/2014
  • MySql 5.5+
  • SQLite 3.7+
  • Postgre SQL 9.2+
  • Firebird 2.5+
  • SQL Server Compact Edition 4.0+

Secondly, add a new async version of the session API (.NET 4.5 only) which supports the async/await features of C# 5.

The .NET 3.5 and 4.0 builds of MicroLite will continue to exist and support the current synchronous API via IReadOnlySession and ISession.

The .NET 4.5 build will add new IAsyncReadOnlySession and IAsyncSession interfaces which will expose the async versions of the API.

e.g.

var customer = await session.SingleAsync<Customer>(1024);

The .NET 4.5 build will also keep the synchronous API to maintain backwards compatibility but we will mark them obsolete (as a warning only) to help make developers aware of the async versions.

The async API will be released in MicroLite 6.0 (see GitHub Milestone). Depending on when the Oracle and Sybase implementations are completed, we may release a 5.4 build of MicroLite containing them or if not they should hopefully be included in 6.0.

MicroLite Impresses Reviewer

The author of this post The Sorry State of .NET ORMs recently got in contact to let me know how impressed he was with MicroLite and that it came out top among all the ORMs he tested.

I won’t re-post his entire review, but here are a few points I appreciated:

MicroLite will actually not only configure much of its use by convention, but also will handle things like opening/closing connections for you, pooling your connections and much, much more.

It’s nice to see convention based mapping we added in an earlier version has helped reduce the setup of a new application and to understand some of the work MicroLite saves you from having to do yourself to get data between your application and database.

The documentation had me up and running in less than 10 minutes from knowing absolutely nothing about the lib

This is great! documentation is always the least fun thing to do as a developer and keeping it up to date and meaningful is always a challenge so it’s nice to know we’re doing a good job.

All in all, I have to admit to being very impressed.

Thank you!

Support for Sequences

Sequences are used in some databases as an alternative to identity or auto increment columns. As of MicroLite 5.3, sequence support has been added for the following databases:

  • MS SQL 2012 or newer
  • Firebird

If you wish to use sequences, you will need to alter how you configure identifiers for mapped classes:

If you use attribute based mapping, change to use IdentifierStrategy.Sequence and also specify the sequence name:

[Column("CustomerId")]
[Identifier(IdentifierStrategy.Sequence, "CustomerIdSequence")]
public int Id { get; set; }

If you use convention based mapping, you will need to specify a convention in the configuration (for example, “ClassName_IdName_Sequence” – e.g. Customer_Id_Sequence):

ResolveSequenceName = (PropertyInfo propertyInfo) =>
{
    return propertyInfo.DeclaringType.Name + "_" + propertyInfo.Name + "_Sequence";
}

That’s all there is to it, MicroLite will take care of assigning the sequence value to the identifier property after performing an Insert (as it does with IdentifierStrategy.DbGenerated).

MicroLite 5.3 Released

MicroLite 5.3.0 has been released on NuGet.

The release mainly focuses on implementing support for database sequences and also an updated dialect which supports the new features in MS SQL 2012 onwards.

In addition, we have improved the SqlBuilder – it now supports In(params SqlQuery[] sqlQueries) and NotIn(params SqlQuery[] sqlQueries).

We covered the changes with examples in the MicroLite 5.3 upcoming features post so see that for further details.