列设置nullable只支持RequiredAttribute和Nullable<>

This commit is contained in:
falcon 2022-09-29 17:32:09 +08:00
parent e8b8b6000d
commit dfc4e91cd6

View File

@ -37,13 +37,13 @@ namespace Falcon.SugarApi.DatabaseDefinitions
//if (sc != null) {
// c.IsNullable = sc.IsNullable;
//}
var isNullableTypes = new Type[] { typeof(string) };
if (isNullableTypes.Contains(pt)) {
c.IsNullable = true;
}
else {
c.IsNullable = false;
}
//var isNullableTypes = new Type[] { typeof(string) };
//if (isNullableTypes.Contains(pt)) {
// c.IsNullable = true;
//}
//else {
// c.IsNullable = false;
//}
//if (pt == typeof(string) && pt.GetCustomAttribute<RequiredAttribute>() == null) {
// c.IsNullable = true;
//}