Strongly icon indicating copy to clipboard operation
Strongly copied to clipboard

Add support for Dictionary serialization when StronglyId is a key in System.Text.Json

Open huberttrueselftrueme opened this issue 1 year ago • 1 comments

To add this support JsonConverter need to have override 2 methods.

public override Id ReadAsPropertyName(...)
public override void WriteAsPropertyName(...)

Now it is impossible to model like.

class MyFoo { prop Dictionary<StronglyId, ...> MyProperty {get; set;} }

huberttrueselftrueme avatar Dec 05 '24 17:12 huberttrueselftrueme

looks reasonable!

Do you mind doing a PR on this?

lucasteles avatar Dec 12 '24 13:12 lucasteles