Strings also should be allowed to respect allownull

This commit is contained in:
2024-08-05 14:36:25 +02:00
parent 3921c176ce
commit 8ed62a378f
2 changed files with 3 additions and 3 deletions

View File

@@ -13968,8 +13968,8 @@ namespace DynamORM
throw new InvalidOperationException("Enumerables of enumerables are not supported");
Column = attr;
if (attr != null && attr.AllowNull && !Type.IsNullableType())
if (attr != null && attr.AllowNull && !Type.IsNullableType() && Type != typeof(string))
attr.AllowNull = false;
if (property.CanRead)

View File

@@ -111,7 +111,7 @@ namespace DynamORM.Mapper
Column = attr;
if (attr != null && attr.AllowNull && !Type.IsNullableType())
if (attr != null && attr.AllowNull && !Type.IsNullableType() && Type != typeof(string))
attr.AllowNull = false;
if (property.CanRead)