From 64418fb9e91bfa8e782dffadfd6045700279b706 Mon Sep 17 00:00:00 2001 From: Railz Date: Mon, 30 Sep 2019 19:49:38 +0200 Subject: [PATCH] Added conversion fo specific types to match correct type before filling --- Database-Attribute_System/ClassAction.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Database-Attribute_System/ClassAction.cs b/Database-Attribute_System/ClassAction.cs index 01f6338..4ba59d4 100644 --- a/Database-Attribute_System/ClassAction.cs +++ b/Database-Attribute_System/ClassAction.cs @@ -71,7 +71,9 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System object value = data_keySet.Value; if (!(value is DBNull)) // Check if value is empty { - //if (baseAttribute.parentField.FieldType == typeof(Guid)) value = new Guid((string)value); // If its a guid, i need to convert + // Convert type if necessary + if (baseAttribute.parentField.FieldType == typeof(Guid)) value = new Guid((string)value); + if (baseAttribute.parentField.FieldType == typeof(char)) value = (char)value; baseAttribute.parentField.SetValue(classObject, value); break;