-
Notifications
You must be signed in to change notification settings - Fork 14
fix(mappings): add conditional check to DateOfBirth property #216
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
Conversation
WalkthroughThe change updates the mapping logic for the Changes
Possibly related issues
Possibly related PRs
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Dotnet.Samples.AspNetCore.WebApi/Mappings/PlayerMappingProfile.cs (1)
40-40: LGTM! Good fix for preventing the NullReferenceException.The change correctly handles null
DateOfBirthvalues by checking withHasValuebefore formatting the date. This will prevent the NullReferenceException mentioned in the PR title.Minor suggestion: Add spaces around the lambda arrow and ternary operator for better readability:
-options.MapFrom(source =>source.DateOfBirth.HasValue? $"{source.DateOfBirth:MMMM d, yyyy}":string.Empty) +options.MapFrom(source => source.DateOfBirth.HasValue ? $"{source.DateOfBirth:MMMM d, yyyy}" : string.Empty)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Dotnet.Samples.AspNetCore.WebApi/Mappings/PlayerMappingProfile.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Codacy Static Code Analysis
|
Thanks for the contribution @lakshmia28 ! 🙌 Before we can merge this, could you please update your commit message to follow the Conventional Commits specification? This helps us keep a clean and consistent project history. A typical format looks like: <type>(optional scope): <short description>Example: fix: add conditional check to Birth mappingExample (scoped): fix(mappings): add conditional check to Birth property |
|
@nanotaboada : Changed the commit message |
|
|
Hi @lakshmia28 ! Thanks for the update — it looks like the PR title was changed, but the commit message itself remains the same: 11052b0 You might need to amend the commit message or redo it and push again. Let me know if you’d like a hand with that! |
|
Why this won’t throw an exception
|



Summary by CodeRabbit