修复一个Nullable设置错误
This commit is contained in:
parent
6a888ca9be
commit
5dddabe868
|
@ -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<RequiredAttribute>() != null) {
|
||||
if (p.GetCustomAttribute<RequiredAttribute>() != null) {
|
||||
c.IsNullable = false;
|
||||
return;
|
||||
}
|
||||
var pt = p.PropertyType;
|
||||
if (pt.IsGenericType && pt.GetGenericTypeDefinition() == typeof(Nullable<>)) {
|
||||
c.IsNullable = true;
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user