How can we improve Breeze.js?

Don't initialize property values

Currently, when breeze creates a new entity it initializes each property based on its type. Uses 0 for an int, empty for string and so on. It uses null for a nullable property. Seems reasonable until you actually use it. When I create a new entity, I want it to fail validation until the user actually fills in values. For non-nullable types, I want null. Otherwise, the user might accidentally save the default value -- which almost certainly is wrong for them. For a nullable type, it would be nice to initialize to value that's invalid ... other than null. Hey JS has undefined. So, for consistency all values should be initialized to undefined ... or as they do in the JS world just not initialized.

Note that this idea is similar to "Entity creation: Initialise Foreign Key - Properties which are Nullable with Null (Currently it's 0)". At first I added my votes to that, but that one is poorly worded and it's scope is much smaller than this.

2 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    SteveB shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base