Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent setting non-nullable reference properties to NULL #15

Open
dotnet-bot opened this issue Jan 30, 2015 · 1 comment
Open

Prevent setting non-nullable reference properties to NULL #15

dotnet-bot opened this issue Jan 30, 2015 · 1 comment

Comments

@dotnet-bot
Copy link
Collaborator

Issue by piotrpMSFT
Tuesday Jan 20, 2015 at 19:16 GMT
Originally opened as https://github.com/Microsoft/vipr-old/issues/50


OData supports properties of structrural reference types [e.g. string, Complex Types]. These reference type properties can be specified to be nullable or non-nullable. When non-nullable, the generated proxy cannot express that a user is unable to set the value to null.

When a user tries setting such a property's value to null we could throw an exception from the property Setter. It is unclear if this is necessary or beneficial since the generated proxy would not provide design-time support for preventing invalid code, and a runtime exception would be propagated from the service when a request is made.

@TheRealPiotrP
Copy link
Contributor

Issue #30 has a proposed design which seems analagous to this problem. A solution here would be to introduce a construct akin to Nullable called NonNullable [or similar]. NonNullable would support setting its internal Value property to any value but null. This construct would itself be wrapped in a Fetchable [or whatever we decide to call it] such that it can exist in the uninitialized state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants