From 22e45342964d0594bbffce9a8373e428a057549a Mon Sep 17 00:00:00 2001 From: "grzegorz.russek" Date: Wed, 19 Oct 2016 08:36:38 +0000 Subject: [PATCH] --- AmalgamationTool/AmalgamationTool.csproj | 4 +++- AmalgamationTool/DynamORM.Amalgamation.cs | 6 +++--- DynamORM/Builders/Implementation/DynamicQueryBuilder.cs | 2 +- DynamORM/DynamicDatabase.cs | 7 ++++--- Tester/Program.cs | 8 ++++---- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/AmalgamationTool/AmalgamationTool.csproj b/AmalgamationTool/AmalgamationTool.csproj index 76fb7a7..13f567a 100644 --- a/AmalgamationTool/AmalgamationTool.csproj +++ b/AmalgamationTool/AmalgamationTool.csproj @@ -43,7 +43,9 @@ - + + True + diff --git a/AmalgamationTool/DynamORM.Amalgamation.cs b/AmalgamationTool/DynamORM.Amalgamation.cs index 5878c32..4a90825 100644 --- a/AmalgamationTool/DynamORM.Amalgamation.cs +++ b/AmalgamationTool/DynamORM.Amalgamation.cs @@ -2749,7 +2749,7 @@ namespace DynamORM /// Reads the type of column from the schema. /// The schema. - /// GEneric parameter type. + /// Generic parameter type. protected virtual DbType ReadSchemaType(dynamic schema) { Type type = (Type)schema.DATATYPE; @@ -2757,7 +2757,7 @@ namespace DynamORM // Small hack for SQL Server Provider if (type == typeof(string) && Provider != null && Provider.GetType() == typeof(System.Data.SqlClient.SqlClientFactory)) { - var map = (schema as IDictionary); + var map = schema as IDictionary; string typeName = (map.TryGetValue("DATATYPENAME") ?? string.Empty).ToString(); switch (typeName) @@ -7874,7 +7874,7 @@ namespace DynamORM return string.Format("({0})", str); // TODO: Make special condiion - //throw new InvalidOperationException(string.Format("The parameters in this command '{0}' cannot be added to a null collection.", node.Parameters)); + ////throw new InvalidOperationException(string.Format("The parameters in this command '{0}' cannot be added to a null collection.", node.Parameters)); // Copy parameters to new comand foreach (KeyValuePair parameter in node.Parameters) diff --git a/DynamORM/Builders/Implementation/DynamicQueryBuilder.cs b/DynamORM/Builders/Implementation/DynamicQueryBuilder.cs index 75bad9c..28258ff 100644 --- a/DynamORM/Builders/Implementation/DynamicQueryBuilder.cs +++ b/DynamORM/Builders/Implementation/DynamicQueryBuilder.cs @@ -413,7 +413,7 @@ namespace DynamORM.Builders.Implementation return string.Format("({0})", str); // TODO: Make special condiion - //throw new InvalidOperationException(string.Format("The parameters in this command '{0}' cannot be added to a null collection.", node.Parameters)); + ////throw new InvalidOperationException(string.Format("The parameters in this command '{0}' cannot be added to a null collection.", node.Parameters)); // Copy parameters to new comand foreach (KeyValuePair parameter in node.Parameters) diff --git a/DynamORM/DynamicDatabase.cs b/DynamORM/DynamicDatabase.cs index c207000..0617ba1 100644 --- a/DynamORM/DynamicDatabase.cs +++ b/DynamORM/DynamicDatabase.cs @@ -1374,7 +1374,7 @@ namespace DynamORM /// Reads the type of column from the schema. /// The schema. - /// GEneric parameter type. + /// Generic parameter type. protected virtual DbType ReadSchemaType(dynamic schema) { Type type = (Type)schema.DATATYPE; @@ -1382,10 +1382,11 @@ namespace DynamORM // Small hack for SQL Server Provider if (type == typeof(string) && Provider != null && Provider.GetType() == typeof(System.Data.SqlClient.SqlClientFactory)) { - var map = (schema as IDictionary); + var map = schema as IDictionary; string typeName = (map.TryGetValue("DATATYPENAME") ?? string.Empty).ToString(); - switch (typeName){ + switch (typeName) + { case "varchar": return DbType.AnsiString; case "nvarchar": diff --git a/Tester/Program.cs b/Tester/Program.cs index 2ae5ef6..dfb0f44 100644 --- a/Tester/Program.cs +++ b/Tester/Program.cs @@ -13,10 +13,10 @@ namespace Tester DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction | DynamORM.DynamicDatabaseOptions.SupportStoredProcedures | DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportTop); - //return new DynamORM.DynamicDatabase(System.Data.SQLite.SQLiteFactory.Instance, - // "Data Source=test.db3;", - // DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction | - // DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportLimitOffset); + ////return new DynamORM.DynamicDatabase(System.Data.SQLite.SQLiteFactory.Instance, + //// "Data Source=test.db3;", + //// DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction | + //// DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportLimitOffset); } private static void Main(string[] args)