Skip to content

Updates to value converter docs - #3020

Merged
ajcvickers merged 3 commits into
masterfrom
BobsAndBits0112
Jan 19, 2021
Merged

ajcvickers merged 3 commits into
masterfrom
BobsAndBits0112

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Lots of examples!

Fixes #614
Fixes #784
Part of #685
Fixes #2252
Fixes #2415
Fixes #2456
Fixes #2824
Fixes #2979

@ajcvickers
ajcvickers requested a review from a team January 17, 2021 16:44
Lots of examples!

Fixes #614
Fixes #784
Part of #685
Fixes #2252
Fixes #2415
Fixes #2456
Fixes #2824
Fixes #2979

@roji roji left a comment

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.

Awesome, love the examples.


### Handle fixed-length database strings

The previous example did not need a value converter. However, a converter can be useful for fixed-length database string types like `char(20)` or `nchar(20)`. Fixed-length strings are padded to their full length whenever a value is inserted into the database. This means that a key value of "dotnet" will be read back from the database as "dotnet ". This will then not compare correctly with key values that are not padded.

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.

Suggested change
The previous example did not need a value converter. However, a converter can be useful for fixed-length database string types like `char(20)` or `nchar(20)`. Fixed-length strings are padded to their full length whenever a value is inserted into the database. This means that a key value of "dotnet" will be read back from the database as "dotnet ". This will then not compare correctly with key values that are not padded.
The previous example did not need a value converter. However, a converter can be useful for fixed-length database string types like `char(20)` or `nchar(20)`. Fixed-length strings are padded to their full length whenever a value is inserted into the database. This means that a key value of `dotnet` will be read back from the database as `dotnet `. This will then not compare correctly with key values that are not padded.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are fences really appropriate here? These are actually string values, not, not language concepts or typpes.

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.

That's true, but (a) the spaces don't really show, and (b) "dotnet" may get machine-translated (to who knows what)...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Turns out we are not allowed trailing spaces in fences, so leaving as is.

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.

Oh well...

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