diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs index 6918e68..d7a5f84 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs @@ -22,11 +22,11 @@ namespace Falcon.SugarApi.DatabaseDefinitions this.ConfigureExternalServices ??= new ConfigureExternalServices { }; //设置Nullable this.ConfigureExternalServices.EntityService += (p, c) => { - var pt = p.PropertyType; - if (pt.GetCustomAttribute() != null) { + if (p.GetCustomAttribute() != null) { c.IsNullable = false; return; } + var pt = p.PropertyType; if (pt.IsGenericType && pt.GetGenericTypeDefinition() == typeof(Nullable<>)) { c.IsNullable = true; return;