StephenCleary / AsyncEx

A helper library for async/await.
MIT License
3.53k stars 356 forks source link

Using LazyAsync with JSONSeralizer? #273

Closed rklec closed 1 year ago

rklec commented 1 year ago

Can one use LazyAsync with Newtonsoft's JSON Serializer?

I tried and get only the internal objects as results, which are serialized, instead of the expected type, actually.

StephenCleary commented 1 year ago

AsyncLazy has no special behavior for serialization. You should be able to write a custom serializer if you need to. It'll be up to your code whether it should cause the initialization to execute or not.