Skip to content
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

LineEndingMode - Support TypeConverter on NETSTANDARD1_3 #4552

Merged
merged 1 commit into from Sep 6, 2021

Conversation

snakefoot
Copy link
Contributor

#3469 added support for TypeConverter on NETSTANDARD1_3. Just forgot to enable this one.

@snakefoot snakefoot added the enhancement Improvement on existing feature label Sep 6, 2021
@snakefoot snakefoot added this to the 5.0 (new) milestone Sep 6, 2021
@snakefoot snakefoot enabled auto-merge (squash) September 6, 2021 18:50
@snakefoot
Copy link
Contributor Author

Also tempted to remove IConvertible from the NLog LogLevel-type as it works better with Json.Net :)

@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@snakefoot snakefoot merged commit cafe5b6 into NLog:dev Sep 6, 2021
@304NotModified
Copy link
Member

Also tempted to remove IConvertible from the NLog LogLevel-type as it works better with Json.Net :)

Isn't the IConvertible helping the db target?
I'm trying to determine what the result will be for removing
IConvertible.

Also any idea about system.text.json

@snakefoot
Copy link
Contributor Author

snakefoot commented Sep 7, 2021

Isn't the IConvertible helping the db target?

The db-target also supports TypeConverter so can still convert LogLevel into string / ordinal based on destination-type.

@snakefoot
Copy link
Contributor Author

snakefoot commented Sep 7, 2021

Also any idea about system.text.json

system.text.json does not support TypeConverter or IConvertible out of the box, but just serialize all LogLevel-properties and fails to deserialize (because no public LogLevel-constructor). Also the problem with IConvertible is that you can only convert in one direction. But you can provide your own System.Json.Net JsonSerializerOptions that includes a converter enabling TypeConverter-support (so it can serialize and deserialize).

@snakefoot snakefoot deleted the typeconverter-netstandard branch July 30, 2022 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement on existing feature size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants