In the Manual it says there is a Nullable property for the [Field()] attribute. What is it's default?

Regards Paul Sinnema Diartis AG

PS: There are a lot of properties available. It would be good to document their defaults as well.

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Jul 06 '10 at 11:02

Paul%20Sinnema's gravatar image

Paul Sinnema

One Answer:

General rule: default value for any field is the value that is mapped to SQL default for its column(s).

Thus if field is non-nullable, default is:

  • its zero (0) value;

  • its minimal possible value, if 0 value isn't supported by DB - e.g. for DateTime fields in some cases;

  • empty string for strings. Note that Oracle considers them equal to NULL (+ there are few more strange things here).

Otherwise (if field is nullable), default is null.

answered Jul 06 '10 at 15:06

Alex%20Yakunin's gravatar image

Alex Yakunin

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA