Composition fixes

This commit is contained in:
Stephan
2018-11-27 13:46:43 +01:00
parent 5b111f9629
commit c23c7749b4
54 changed files with 158 additions and 150 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using NPoco;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Scoping;
@@ -97,7 +98,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
}
}
internal ServerVersionInfo GetSetVersion(string connectionString, string providerName)
internal ServerVersionInfo GetSetVersion(string connectionString, string providerName, ILogger logger)
{
var factory = DbProviderFactories.GetFactory(providerName);
var connection = factory.CreateConnection();
@@ -132,12 +133,14 @@ namespace Umbraco.Core.Persistence.SqlSyntax
command.CommandText = sql;
using (var reader = command.ExecuteReader())
{
reader.Read();
version = new ServerVersionInfo(reader.GetString(0), reader.GetString(2), reader.GetString(3), (EngineEdition) reader.GetInt32(5), reader.GetString(7), reader.GetString(9));
}
connection.Close();
}
catch
catch (Exception e)
{
logger.Error<UmbracoDatabaseFactory>(e, "Failed to detected SqlServer version.");
version = new ServerVersionInfo(); // all unknown
}
}