-
Notifications
You must be signed in to change notification settings - Fork 24
DOCSP-42606: class maps feedback #592
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docs-csharp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions:
level by using attributes with the class or by calling methods while registering | ||
a class map. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't add this, but I think this should be changed?
level by using attributes with the class or by calling methods while registering | |
a class map. | |
level by using attributes within the class or by calling methods while registering | |
a class map. |
You can use GUIDs instead of ``ObjectId`` values to represent your | ||
document IDs in MongoDB. By default, the driver uses the | ||
``GuidGenerator`` type to generate a unique value for the ID property. | ||
You must specify the GUID representation by initializing a | ||
``GuidSerializer``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the description in the String IDs
section, this seems like it goes against MongoDB best practices. Is there a reason we don't recommend this? Or is there a specific use case where we would recommend this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the wording here to not suggest using GUIDs
Some people are migrating to MongoDB using legacy data, which might use UUIDs/GUIDs as the unique identifiers.
|
||
Even if you specify a value for the ``YearBuilt`` property, the field is | ||
not saved in MongoDB. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add a reciprocal note that links to instructions for omitting during mapping.
Omit Fields | ||
~~~~~~~~~~~ | ||
|
||
By default, the driver serializes all fields in your POCOS, whether you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POCOs?
~~~~~~~~~~~ | ||
|
||
By default, the driver serializes all fields in your POCOS, whether you | ||
define them or not. You can prevent specified fields from being |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "define" you probably mean map/automap?. As a field in POCO is it's definition, therefore always defined.
I'd just omit that part.
|
||
You cannot use the ``[BsonIgnoreIfNull]`` attribute or | ||
``SetIgnoreIfNull()`` method to prevent undefined numerical | ||
properties from being serialized unless you mark the properties as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"undefined numerical property" wording might be confusing for .NET users, as numeric (value) values are always defined. 'Uninitialized' or 'default' sound better.
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-42606
Staging Links
Self-Review Checklist