- maintain CreateInstanceGetDefaultValue

This commit is contained in:
2881099 2020-10-26 02:51:42 +08:00
parent 8ca75db2a4
commit 1a05d63a96

View File

@ -131,6 +131,7 @@ public static partial class FreeSqlGlobalExtensions
if (that == null) return null; if (that == null) return null;
if (that == typeof(string)) return default(string); if (that == typeof(string)) return default(string);
if (that == typeof(Guid)) return default(Guid); if (that == typeof(Guid)) return default(Guid);
if (that == typeof(byte[])) return default(byte[]);
if (that.IsArray) return Array.CreateInstance(that.GetElementType(), 0); if (that.IsArray) return Array.CreateInstance(that.GetElementType(), 0);
if (that.IsInterface || that.IsAbstract) return null; if (that.IsInterface || that.IsAbstract) return null;
var ctorParms = that.InternalGetTypeConstructor0OrFirst(false)?.GetParameters(); var ctorParms = that.InternalGetTypeConstructor0OrFirst(false)?.GetParameters();