matteobortolazzo / couchdb-net

EF Core-like CouchDB experience for .NET!
MIT License
129 stars 30 forks source link

Use of System.Text.Json #145

Open dmrayt opened 3 years ago

dmrayt commented 3 years ago

Hi! Is there some plan to support System.Text.Json?

For Flurl, it's already possible with https://github.com/YellowLineParking/Appy.Flurl.

matteobortolazzo commented 3 years ago

Hi, no plan for it yet. I would like to keep Newtonsoft option available so people don't need to change their code too much. I haven't researched it yet

dmrayt commented 3 years ago

I didn't mean to replace Newtonsoft but add support for System.Text.Json as an option.

I don't know how much you use from Newtonsoft but the first step could be to use attributes from both library in your models. e.g:

  [System.Text.Json.Serialization.JsonPropertyName("_rev")]
  [Newtonsoft.Json.JsonProperty("_rev")]
  public string Rev { get; set; }
matteobortolazzo commented 2 years ago

That's technically true, but I dont want to have both libraries there. I want NewtonSoft one to be optional with a second NuGet package. But I want to move to System.Text.Json as well

matteobortolazzo commented 2 years ago

So I did a bit of research, even if I want to implement System.Text.Json, it will take a huge amount of work. The NetwonSoft is used everywhere from deserialization of internal classes to options.

So I will keep this here not there will no updates in the near future