MicroLite ORM v7.0.0 Release Notes

Release Date: 2020-03-27 // 11 months ago
  • MicroLite 7.0.0 contains a number of changes over 6.3.4:

    • ๐Ÿ— The library is now .NET 4.5 only, the .NET 3.5, 4.0 and 4.6 builds have been removed
    • โœ… The library is now using the .NET Standard project format, tests are now .NET 4.8 and xUnit 2.4.1
    • ๐Ÿ— Build is migrated to Azure DevOps YAML
    • ๐Ÿ’… Code style updated using .editorconfig and enforced via StyleCop
    • C# 7.3 language features (Expression bodied members, Pattern Matching, Throw expressions etc.)
    • โž• Added SecurityCodeScan and SonarAnalyzer.CSharp Roslyn analyzer packages to ensure code quality
    • ๐Ÿ’ฅ Breaking Change The API is now Async only, the IAsync..Session interfaces are removed and the I...Session interfaces now only contain the async methods
    • ๐Ÿ’ฅ Breaking Change SqlServer CE support removed

    The following issues have been resolved:

    • ๐Ÿ— #484 - Select builder adds extra parenthesis

    โฌ†๏ธ Upgrade Scenarios

    Using .NET 3.5 or 4.0

    Remain on MicroLite 6.3.4 until you can migrate to .NET 4.5 or later.

    Using SQL Server Compact Edition

    Remain on MicroLite 6.3.4 until you can migrate to an alternative database (e.g. SQLite).

    Using .NET 4.5 or later and not currently using Async sessions

    • โšก๏ธ Update to MicroLite 7.0
    • โšก๏ธ Update to use async versions of ISession/IReadOnlySession interfaces
    • e.g. var customer = session.Single(123); => var customer = await session.SingleAsync(123);

    Using .NET 4.5 or later and already using Async sessions

    • โšก๏ธ Update to MicroLite 7.0, find and replace:
      • IAsyncSession with ISession
      • IAsyncReadOnlySession with IReadOnlySession
      • IAdvancedAsyncSession with IAdvancedSession
      • IAdvancedAsyncReadOnlySession with IAdvancedReadOnlySession
      • OpenAsyncSession() with OpenSession()
      • OpenAsyncReadOnlySession() with OpenReadOnlySession()

    The following API changes exist MicroLite 6.3.4 to 7.0.0

    MicroLite

    - public interface IAdvancedAsyncReadOnlySession- public interface IAdvancedAsyncSession- public interface IAsyncReadOnlySession- public interface IAsyncSession- public interface IHideObjectMethods
    

    IAdvancedReadOnlySession

    - void ExecutePendingQueries();+ Task ExecutePendingQueriesAsync();+ Task ExecutePendingQueriesAsync(CancellationToken cancellationToken);
    

    IAdvancedSession

    - bool Delete(Type type, object identifier);- T ExecuteScalar\<T\>(SqlQuery sqlQuery);- bool Update(ObjectDelta objectDelta);+ Task\<bool\> DeleteAsync(Type type, object identifier);+ Task\<bool\> DeleteAsync(Type type, object identifier, CancellationToken cancellationToken);+ Task\<int\> ExecuteAsync(SqlQuery sqlQuery);+ Task\<int\> ExecuteAsync(SqlQuery sqlQuery, CancellationToken cancellationToken);+ Task\<T\> ExecuteScalarAsync\<T\>(SqlQuery sqlQuery);+ Task\<T\> ExecuteScalarAsync\<T\>(SqlQuery sqlQuery, CancellationToken cancellationToken);+ Task\<bool\> UpdateAsync(ObjectDelta objectDelta);+ Task\<bool\> UpdateAsync(ObjectDelta objectDelta, CancellationToken cancellationToken);
    

    IReadOnlySession

    - IList\<T\> Fetch\<T\>(SqlQuery sqlQuery);- PagedResult\<T\> Paged\<T\>(SqlQuery sqlQuery, PagingOptions pagingOptions);- T Single\<T\>(object identifier) where T : class, new();- T Single\<T\>(SqlQuery sqlQuery);+ Task\<IList\<T\>\> FetchAsync\<T\>(SqlQuery sqlQuery);+ Task\<IList\<T\>\> FetchAsync\<T\>(SqlQuery sqlQuery, CancellationToken cancellationToken);+ Task\<PagedResult\<T\>\> PagedAsync\<T\>(SqlQuery sqlQuery, PagingOptions pagingOptions);+ Task\<PagedResult\<T\>\> PagedAsync\<T\>(SqlQuery sqlQuery, PagingOptions pagingOptions, CancellationToken cancellationToken);+ Task\<T\> SingleAsync\<T\>(object identifier) where T : class, new();+ Task\<T\> SingleAsync\<T\>(object identifier, CancellationToken cancellationToken) where T : class, new();+ Task\<T\> SingleAsync\<T\>(SqlQuery sqlQuery);+ Task\<T\> SingleAsync\<T\>(SqlQuery sqlQuery, CancellationToken cancellationToken);
    

    ISession

    - bool Delete(object instance);- void Insert(object instance);- bool Update(object instance);+ Task\<bool\> DeleteAsync(object instance);+ Task\<bool\> DeleteAsync(object instance, CancellationToken cancellationToken);+ Task InsertAsync(object instance);+ Task InsertAsync(object instance, CancellationToken cancellationToken);+ Task\<bool\> UpdateAsync(object instance);+ Task\<bool\> UpdateAsync(object instance, CancellationToken cancellationToken);
    

    ISessionFactory

    - IAsyncReadOnlySession OpenAsyncReadOnlySession();- IAsyncReadOnlySession OpenAsyncReadOnlySession(ConnectionScope connectionScope);- IAsyncSession OpenAsyncSession();- IAsyncSession OpenAsyncSession(ConnectionScope connectionScope);
    

    ๐Ÿ”ง Configuration

    ๐Ÿ”ง ConfigurationExtensions

    - public static ICreateSessionFactory ForSqlServerCeConnection(this IConfigureConnection configureConnection, string connectionName)- public static ICreateSessionFactory ForSqlServerCeConnection(this IConfigureConnection configureConnection, string connectionName, string connectionString, string providerName)
    

    Infrastructure

    - public interface IHaveAsyncReadOnlySession- public interface IHaveAsyncSession
    

    IHaveReadOnlySession

    - IReadOnlySession Session { get; set; }+ IReadOnlySession Session { get; }
    

    IHaveSession

    - ISession Session { get; set; }+ ISession Session { get; }
    

    view code changes


Previous changes from v6.3.4

  • MicroLite 6.3.4 contains a single change:

    • ๐Ÿ‘ #473 - TypeConverter.ResolveDbType doesnt support Nullable enum, but EnumTypeConverter does

    view code changes