-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
Combination of EventEmitter and TypeConverter #473
Comments
That's not possible because |
The problem remains, even if I register my own implementation of
Is there a generic solution for this? |
I don't know how you got that result. Can you share the code ? |
Woops sorry, here is the example https://dotnetfiddle.net/3t83cZ |
Oh I see. Basically IEventEmitter eventEmitter = null;
var serializer = new SerializerBuilder()
.WithEventEmitter(next => eventEmitter = new ForceQuotedStringValuesEventEmitter(next))
.WithTypeConverter(new CustomDateTimeConverter(() => eventEmitter))
.Build(); |
Since there’s an answer and comment in a long time I’m closing this. |
Is there a way to combine a EventEmitter with a TypeConverter ?
The use case is that all string values should have quotes, and that a DateTime should be displayed without time.
To quote string values I'm using the approach from: #428 (comment)
The problem is, that the Custom ChainedEventEmitter isn't invoked when the DateTimeConverter detects a DateTime value, which leads to weird behavior:
Output:
Desired Output:
Example Code
The text was updated successfully, but these errors were encountered: