From 5dddabe86868defb181942b35c96fea4dd89c00f Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Fri, 9 Sep 2022 12:50:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AANullable?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Falcon.SugarApi/DatabaseDefinitions/SugarConnectionConfig.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;