Uh oh!
There was an error while loading. Please reload this page.
Add OnSerialize callbacks to POCOs - #54709
Conversation
ghost
commented
Jun 24, 2021
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
ghost
commented
Jun 24, 2021
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsResolves #54528 Does not measurable affect performance; the
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
What prevents us from supporting callbacks in collection types?
There was a problem hiding this comment.
Nothing (same for value types) although there are very limited scenarios for both since custom converters would normally be used which implicitly have support for before\after.
Also, a richer interaction model would be better for collections - in order to provide support for "Add()" as well as holding onto any temporary collections needed for things like Arrays, Stacks and immutable collections.
There was a problem hiding this comment.
nit: is this more clear?
| /// Types that have a custom converter or represent collections or values do not support this behavior. | |
| /// Types that have a custom converter or represent collections or primitive values do not support this behavior. |
Uh oh!
There was an error while loading. Please reload this page.
steveharter
commented
Jul 9, 2021
Test failures in mono arm64 Debug appear unrelated: |
Resolves#54528
Does not measurable affect performance; the
is IJsonSerializableetc C# calls appear to be the same performance as a standard "if (bool)" check after a few runs.This does not include the work necessary for source-gen.