MicroLite 5.0 – Reduced Mutability of SqlQuery

In MicroLite 5.0, the mutability of the SqlQuery object has been reduced. Once set via the constructor, the command text can now no longer be changed and the arguments cannot be added to or removed from. This allows us to make some performance improvements within the framework since we know the object cannot change.

The class now looks like this:

public sealed class SqlQuery : IEquatable<SqlQuery>
    private readonly object[] arguments;
    private readonly string commandText;

    public SqlQuery(string commandText, params object[] arguments)
        this.commandText = commandText;
        this.arguments = arguments ?? new object[0];

    public string CommandText { get { return this.commandText; } }

2 thoughts on “MicroLite 5.0 – Reduced Mutability of SqlQuery

  1. Pingback: MicroLite 5.0 – Removal of methods from IListener | MicroLite ORM

  2. Pingback: MicroLite 5.0 Released | MicroLite ORM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s