From abc672e3489bb30b316e786f5dfd72d82f37571b Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 23 Oct 2014 17:50:10 +0200 Subject: [PATCH 1/2] Fixes VS14 build. SqlCEHelper.cs - the compiler in Vs14 doesn't like that we're callng `public IRecordsReader ExecuteReader(string commandText, params IParameter[] parameters)` like this: `ExecuteNonQuery("alter table [" + table + "] drop constraint [" + constraint + "]");` Added two internal method overloads that just send an empty parameter array instead. --- src/umbraco.datalayer/Properties/AssemblyInfo.cs | 2 ++ src/umbraco.datalayer/SqlHelper.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/umbraco.datalayer/Properties/AssemblyInfo.cs b/src/umbraco.datalayer/Properties/AssemblyInfo.cs index 7f5caaee39..2062f36415 100644 --- a/src/umbraco.datalayer/Properties/AssemblyInfo.cs +++ b/src/umbraco.datalayer/Properties/AssemblyInfo.cs @@ -25,3 +25,5 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6210756f-436d-4536-bad3-d7b000e1694f")] + +[assembly: InternalsVisibleTo("SqlCE4Umbraco")] \ No newline at end of file diff --git a/src/umbraco.datalayer/SqlHelper.cs b/src/umbraco.datalayer/SqlHelper.cs index db5514b34c..b39c38e0b7 100644 --- a/src/umbraco.datalayer/SqlHelper.cs +++ b/src/umbraco.datalayer/SqlHelper.cs @@ -235,6 +235,11 @@ namespace umbraco.DataLayer } } + internal int ExecuteNonQuery(string commandText) + { + return ExecuteNonQuery(commandText, new P[0]); + } + /// /// Executes a command and returns a records reader containing the results. /// @@ -259,6 +264,11 @@ namespace umbraco.DataLayer } } + internal IRecordsReader ExecuteReader(string commandText) + { + return ExecuteReader(commandText, new P[0]); + } + /// /// Executes a command that returns an XML value. /// From 6c2750b0cc67d9379c95c14d244246cf97f843ad Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 24 Oct 2014 10:32:41 +0200 Subject: [PATCH 2/2] Moves fix for VS14 to the SqlCEHelper class itself, InternalsVisibleTo didn't seem to work in VS (worked on command line build though) --- src/SQLCE4Umbraco/SqlCEHelper.cs | 12 ++++++++++++ src/umbraco.datalayer/Properties/AssemblyInfo.cs | 2 -- src/umbraco.datalayer/SqlHelper.cs | 14 ++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/SQLCE4Umbraco/SqlCEHelper.cs b/src/SQLCE4Umbraco/SqlCEHelper.cs index 1787c05912..26a781360e 100644 --- a/src/SQLCE4Umbraco/SqlCEHelper.cs +++ b/src/SQLCE4Umbraco/SqlCEHelper.cs @@ -229,5 +229,17 @@ namespace SqlCE4Umbraco return new SqlCeDataReaderHelper(SqlCeApplicationBlock.ExecuteReader(ConnectionString, CommandType.Text, commandText, parameters)); } + + + internal IRecordsReader ExecuteReader(string commandText) + { + return ExecuteReader(commandText, new SqlCEParameter(string.Empty, string.Empty)); + } + + + internal int ExecuteNonQuery(string commandText) + { + return ExecuteNonQuery(commandText, new SqlCEParameter(string.Empty, string.Empty)); + } } } \ No newline at end of file diff --git a/src/umbraco.datalayer/Properties/AssemblyInfo.cs b/src/umbraco.datalayer/Properties/AssemblyInfo.cs index 2062f36415..7f5caaee39 100644 --- a/src/umbraco.datalayer/Properties/AssemblyInfo.cs +++ b/src/umbraco.datalayer/Properties/AssemblyInfo.cs @@ -25,5 +25,3 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6210756f-436d-4536-bad3-d7b000e1694f")] - -[assembly: InternalsVisibleTo("SqlCE4Umbraco")] \ No newline at end of file diff --git a/src/umbraco.datalayer/SqlHelper.cs b/src/umbraco.datalayer/SqlHelper.cs index b39c38e0b7..db850e6832 100644 --- a/src/umbraco.datalayer/SqlHelper.cs +++ b/src/umbraco.datalayer/SqlHelper.cs @@ -234,12 +234,7 @@ namespace umbraco.DataLayer throw new SqlHelperException("ExecuteNonQuery", commandText, parameters, e); } } - - internal int ExecuteNonQuery(string commandText) - { - return ExecuteNonQuery(commandText, new P[0]); - } - + /// /// Executes a command and returns a records reader containing the results. /// @@ -263,12 +258,7 @@ namespace umbraco.DataLayer throw new SqlHelperException("ExecuteReader", commandText, parameters, e); } } - - internal IRecordsReader ExecuteReader(string commandText) - { - return ExecuteReader(commandText, new P[0]); - } - + /// /// Executes a command that returns an XML value. ///