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

Add [Required] attribute to DB properties #59

Closed
morganbr opened this issue Sep 9, 2018 · 1 comment · Fixed by #243
Closed

Add [Required] attribute to DB properties #59

morganbr opened this issue Sep 9, 2018 · 1 comment · Fixed by #243
Assignees
Labels
infrastructure Deployment and other things related to keeping the site running
Milestone

Comments

@morganbr
Copy link
Contributor

morganbr commented Sep 9, 2018

If a property on an Entity Framework table is a nullable type (such as String or another class), the column is treated as optional and the DB will accept null. For values that shouldn't be null, we should set the [Required] attribute.

@morganbr
Copy link
Contributor Author

This will also cascade deletes to related entities, which we mostly want. For example, Setting it to the Event property of Puzzle will make it so deleting an event automatically deletes its puzzles.

@jenetlan jenetlan added the infrastructure Deployment and other things related to keeping the site running label Jan 17, 2019
@jenetlan jenetlan added this to the P1 milestone Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Deployment and other things related to keeping the site running
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants