-
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
DOCSP-42606: class maps feedback #592
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:
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.
~~~~~~~~~~~ | ||
|
||
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.
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.
Looks good, small change requested.
classMap.MapMember(h => h.Style).SetIgnoreIfNull(true); | ||
}); | ||
|
||
.. note:: Numerical Properties |
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.
Sorry for not catching this earlier: this applies also for any Value Type property (for example bool
, char
).
"Value Type Properties" naming would be more accurate.
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.
LGTM!
* DOCSP-42606: class maps improvements * wip * RM PR fixes 1 * BD tech review comments 1 * BD tech review comments 2 (cherry picked from commit 663bde2)
* DOCSP-42606: class maps improvements * wip * RM PR fixes 1 * BD tech review comments 1 * BD tech review comments 2 (cherry picked from commit 663bde2)
* DOCSP-42606: class maps improvements * wip * RM PR fixes 1 * BD tech review comments 1 * BD tech review comments 2 (cherry picked from commit 663bde2)
* DOCSP-42606: class maps improvements * wip * RM PR fixes 1 * BD tech review comments 1 * BD tech review comments 2 (cherry picked from commit 663bde2)
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-42606
Staging Links
Self-Review Checklist