From 3cb7a54ddc2c414ef73066c9b9d87aff0d986783 Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Tue, 19 Jan 2021 15:26:59 +0300 Subject: [PATCH 1/2] Remove redundant else if --- SPToCore/Program.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SPToCore/Program.cs b/SPToCore/Program.cs index f49a775..0915dc7 100644 --- a/SPToCore/Program.cs +++ b/SPToCore/Program.cs @@ -300,8 +300,6 @@ private static string SP_GetType(string type,bool isNullable) return "int" + (isNullable ? "?" : ""); else if (type == "tinyint") return "Byte" + (isNullable ? "?" : ""); - else if (type == "bigint") - return "Int64" + (isNullable ? "?" : ""); else if (type.IndexOf("decimal") > -1) return "decimal" + (isNullable ? "?" : ""); else if (type.IndexOf("nvarchar") > -1) @@ -344,8 +342,6 @@ private static string SP_GetDbType(string type) return "Int16"; else if (type == "tinyint") return "Byte"; - else if (type == "bigint") - return "Int64"; else if (type.IndexOf("decimal") > -1) return "Decimal"; else if (type.IndexOf("nvarchar") > -1) From dc1340a9c6808f6e8378d2b69b819604d6506b8f Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Tue, 19 Jan 2021 15:28:40 +0300 Subject: [PATCH 2/2] Do not create empty DataTable objects --- SPToCore/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SPToCore/Program.cs b/SPToCore/Program.cs index 0915dc7..58e636a 100644 --- a/SPToCore/Program.cs +++ b/SPToCore/Program.cs @@ -46,9 +46,9 @@ static async Task Main(string[] args) public static void SPToCoreScan() { - var dt_SpList = new DataTable(); - var dt_SpParam = new DataTable(); - var dt_SpResult = new DataTable(); + DataTable dt_SpList; + DataTable dt_SpParam; + DataTable dt_SpResult; Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH':'mm':'ss")} STEP 1 - GET STORED PROCEDURE LIST");