From 11ce365d1182727105349ace80257c0edfcc7aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Patrik=20Pa=C5=A1ko?= <pasko@infotech.sk>
Date: Tue, 22 Jun 2021 17:16:58 +0200
Subject: [PATCH] - Supported type translation added

---
 tUtils/SupportedTypes.cs | 25 +++++++++++++++++++++++++
 tUtils/Utils.cs          |  2 +-
 tUtils/tUtils.csproj     | 15 +++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 tUtils/SupportedTypes.cs

diff --git a/tUtils/SupportedTypes.cs b/tUtils/SupportedTypes.cs
new file mode 100644
index 0000000..76c3403
--- /dev/null
+++ b/tUtils/SupportedTypes.cs
@@ -0,0 +1,25 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace tUtils
+{
+
+    public class SupportedTypes
+    {
+        private static HashSet<string> allowedTypes = new HashSet<string>
+        {
+            "Byte", "Boolean",
+            "Int32", "UInt32", "Int16", "UInt16", "Int64", "UInt64",
+            "Single", "Double", "Decimal",
+            "Char", "String", "DateTime"
+        };
+        
+
+        /// <summary>
+        /// Translates 3rd party type name to supported type name
+        /// </summary>
+        /// <param name="type">3rd party type name</param>
+        /// <returns>Supported type name or null</returns>
+        public static string Translate(string type) => allowedTypes.FirstOrDefault(at => at.ToLower().Contains(type.ToLower()));
+    }
+}
diff --git a/tUtils/Utils.cs b/tUtils/Utils.cs
index f4c824e..55c7b5c 100644
--- a/tUtils/Utils.cs
+++ b/tUtils/Utils.cs
@@ -10,4 +10,4 @@ namespace tUtils
             return (long)span.TotalMilliseconds;
         }
     }
-}
+}
\ No newline at end of file
diff --git a/tUtils/tUtils.csproj b/tUtils/tUtils.csproj
index f208d30..5c19c79 100644
--- a/tUtils/tUtils.csproj
+++ b/tUtils/tUtils.csproj
@@ -2,6 +2,21 @@
 
   <PropertyGroup>
     <TargetFramework>net5.0</TargetFramework>
+    <AssemblyVersion>2021.6.22.2</AssemblyVersion>
+    <FileVersion>2021.6.22.2</FileVersion>
+    <Version>2021.6.0</Version>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
+    <ShouldCreateLogs>True</ShouldCreateLogs>
+    <AdvancedSettingsExpanded>False</AdvancedSettingsExpanded>
+    <UpdateAssemblyVersion>False</UpdateAssemblyVersion>
+    <UpdateAssemblyFileVersion>False</UpdateAssemblyFileVersion>
+    <UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
+    <UpdatePackageVersion>True</UpdatePackageVersion>
+    <PackageVersionSettings>AssemblyVersion.IncrementWithAutoReset.None</PackageVersionSettings>
+    <AssemblyInfoVersionType>SettingsVersion</AssemblyInfoVersionType>
+    <InheritWinAppVersionFrom>None</InheritWinAppVersionFrom>
   </PropertyGroup>
 
 </Project>
-- 
GitLab