mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 修复 non public ctor #291
This commit is contained in:
@ -130,7 +130,7 @@ public static partial class FreeSqlGlobalExtensions
|
||||
if (that == typeof(string)) return default(string);
|
||||
if (that.IsArray) return Array.CreateInstance(that, 0);
|
||||
var ctorParms = that.InternalGetTypeConstructor0OrFirst(false)?.GetParameters();
|
||||
if (ctorParms == null || ctorParms.Any() == false) return Activator.CreateInstance(that, null);
|
||||
if (ctorParms == null || ctorParms.Any() == false) return Activator.CreateInstance(that, true);
|
||||
return Activator.CreateInstance(that, ctorParms.Select(a => a.ParameterType.IsInterface || a.ParameterType.IsAbstract || a.ParameterType == typeof(string) ? null : Activator.CreateInstance(a.ParameterType, null)).ToArray());
|
||||
}
|
||||
internal static NewExpression InternalNewExpression(this Type that)
|
||||
|
Reference in New Issue
Block a user