Allow properties to be nullable #13816
bjarnef
started this conversation in
Features and ideas
Replies: 1 comment 5 replies
-
One could argue if a field is not mandatory, it should be nullable? Thereby we do not need a new setting. Overall I like the idea about making ModelsBuilder Nullable aware. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently when using numeric or decimal properties ModelsBuilder generate these as
int
ogdecimal
, but there doesn't seem to be a way to defined it as nullable, although the property in backoffice is allowed to be empty.Maybe the properties should have a setting "Allow empty" or similar, which will generate to properties as
int?
anddecimal?
instead and it would be easier to handle a fallback value yourself as0
sometimes is a valid value, but can be confusing if some properties are empty while others have the value0
.It can of course use textstring instead
string
, but then one will not get the benefits of the numeric input. An alternative is to use textstring + regex on the property in backoffice to ensure a numeric value, but the generates type is stillstring
.It seems the be the same for textstring which always is generates as
string
and notstring?
.Something like this would be great :)
Beta Was this translation helpful? Give feedback.
All reactions