Skip to content

Add support for scrubbing nullable numeric IDs#352

Merged
SimonCropp merged 1 commit into
VerifyTests:masterfrom
andrewlock:scrub-nullable-ids
May 10, 2021
Merged

Add support for scrubbing nullable numeric IDs#352
SimonCropp merged 1 commit into
VerifyTests:masterfrom
andrewlock:scrub-nullable-ids

Conversation

@andrewlock

Copy link
Copy Markdown
Contributor

#351 Added support for scrubbing numeric IDs (Thanks @SimonCropp! 😄). Just ran into a case where the IDs may be nullable, and as this will be a common scenario for ForeignKey situations, I updated the implementation to support nullable versions.

Tweaked tests to check a nullable ID with and without value.

@SimonCropp SimonCropp added this to the 11.12.1 milestone May 10, 2021
@SimonCropp SimonCropp added the Bug label May 10, 2021
@SimonCropp
SimonCropp merged commit 73baf66 into VerifyTests:master May 10, 2021
@@ -167,7 +167,11 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ
propertyType == typeof(int) ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easier to just do propertyType = Nullable.GetUnderlyingType(propertyType) ?? propertyType; first?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. i will make this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants