✅ Don't quite understand the `required` keyword
although i marked the member as required, i defined a default value in case if it's not in the object initializer. does the keyword not work this way?
8 Replies
Makes the property required
Unconditionally
If you're fine with a default value, make it not required
(also, make it a property)
by property, you mean the get set stuff?
Yes
The general rule of thumb is "if it's public, it should be a property"
oh i see
then what should i be using members?
Fields are usually private
If that's what you mean by "member"
$structure
Here's most of the naming
nice thanks