修复一个Nullable设置错误
This commit is contained in:
parent
6a888ca9be
commit
5dddabe868
|
@ -22,11 +22,11 @@ namespace Falcon.SugarApi.DatabaseDefinitions
|
||||||
this.ConfigureExternalServices ??= new ConfigureExternalServices { };
|
this.ConfigureExternalServices ??= new ConfigureExternalServices { };
|
||||||
//设置Nullable
|
//设置Nullable
|
||||||
this.ConfigureExternalServices.EntityService += (p, c) => {
|
this.ConfigureExternalServices.EntityService += (p, c) => {
|
||||||
var pt = p.PropertyType;
|
if (p.GetCustomAttribute<RequiredAttribute>() != null) {
|
||||||
if (pt.GetCustomAttribute<RequiredAttribute>() != null) {
|
|
||||||
c.IsNullable = false;
|
c.IsNullable = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var pt = p.PropertyType;
|
||||||
if (pt.IsGenericType && pt.GetGenericTypeDefinition() == typeof(Nullable<>)) {
|
if (pt.IsGenericType && pt.GetGenericTypeDefinition() == typeof(Nullable<>)) {
|
||||||
c.IsNullable = true;
|
c.IsNullable = true;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user