diff --git a/ACUtils.Logger/ACUtils.Logger.csproj b/ACUtils.Logger/ACUtils.Logger.csproj
index 63f057d..da689fd 100644
--- a/ACUtils.Logger/ACUtils.Logger.csproj
+++ b/ACUtils.Logger/ACUtils.Logger.csproj
@@ -16,7 +16,6 @@
-
diff --git a/ACUtils.SqlDb.Utils/ACUtils.SqlDb.Utils.csproj b/ACUtils.SqlDb.Utils/ACUtils.SqlDb.Utils.csproj
index 0ff74d9..70a177c 100644
--- a/ACUtils.SqlDb.Utils/ACUtils.SqlDb.Utils.csproj
+++ b/ACUtils.SqlDb.Utils/ACUtils.SqlDb.Utils.csproj
@@ -4,8 +4,8 @@
Andrea Cattaneo
true
false
- 1.0.0.141
- 1.0.0.141
+ 1.0.0.142
+ 1.0.0.142
Utilities per gestione DataTable
it
true
diff --git a/ACUtils.SqlDb.Utils/DBModel.cs b/ACUtils.SqlDb.Utils/DBModel.cs
index 83b194c..366be85 100644
--- a/ACUtils.SqlDb.Utils/DBModel.cs
+++ b/ACUtils.SqlDb.Utils/DBModel.cs
@@ -202,19 +202,24 @@ public virtual void idrate(IDataRecord dataRecord)
}
- protected void setValue(string key, object value, Type colType = null)
+ protected virtual void setValue(string key, object value, Type colType = null)
{
var property = this.GetType().GetProperty(key);
var sourceType = value?.GetType();
var targetType = property.PropertyType;
- if (!property.CanWrite) return;
+ if (!property.CanWrite)
+ return;
// NULL value
if (value == DBNull.Value || value == null)
{
property.SetValue(this, null);
}
+ else if (targetType.IsAssignableFrom(sourceType))
+ {
+ property.SetValue(this, value);
+ }
// boolean
else if (targetType == typeof(bool) || targetType == typeof(bool?))
{
diff --git a/ACUtils.SqlDb/ACUtils.SqlDb.csproj b/ACUtils.SqlDb/ACUtils.SqlDb.csproj
index 8b3b43f..1f6b4de 100644
--- a/ACUtils.SqlDb/ACUtils.SqlDb.csproj
+++ b/ACUtils.SqlDb/ACUtils.SqlDb.csproj
@@ -5,8 +5,8 @@
Andrea Cattaneo
true
false
- 1.0.0.141
- 1.0.0.141
+ 1.0.0.142
+ 1.0.0.142
Utility per interrogazione database MSSQL
it
true