Giter Club home page Giter Club logo

Comments (3)

byme8 avatar byme8 commented on August 30, 2024 1

I was thinking about it initially but decided there was no point in it. System.Json is faster and already "installed" in net6.0+ projects. To make it work, it is not enough to replace the attribute. You have to rewrite the custom serializes for scalar and supported built-in types. Incorporate new options into the source generator. Figured out how to cover all scenarios in the integration tests. I would say a big chunk of work.

What raises the question of what benefits it would bring? Performance? No. Ease of use? They are pretty much the same in most scenarios. Compatibility? System.Text.Json works on netstandard. The only thing I can see is eliminating the dependency on System.Text.Json, which can be useful for projects already using Newtosoft. At the same time, the best path forward is to use a built-in serializer. So, from my perspective, there is no point to invest time in it.

from zeroql.

byme8 avatar byme8 commented on August 30, 2024

I am trying to configure the ASP.NET project to use one serializer or another depending on the controller

I don't get it. Why would you need to configure anything to work with the ZeroQL client? Everything happens under the hood and doesn't require any intervention from the developer side.

from zeroql.

noah-integrityinspired avatar noah-integrityinspired commented on August 30, 2024

I don't get it. Why would you need to configure anything to work with the ZeroQL client? Everything happens under the hood and doesn't require any intervention from the developer side.

Oh totally agree with you; getting the data from the ZeroQL client works like a charm. This is for when I am trying to return a ZeroQL model out of the controller. For example:

public async Task<IActionResult> Get()
{
  var response = await GQLClient.Query(...)
  return Ok(response.Data)
}

Which works just fine when I remove the .AddNewtonsoftJson() when the asp.net up is spun up. But the project needs that since a lot of the controllers in the project were designed for NewtonsoftJson serialization. When I keep the .AddNewtonsoftJson() code, it still returns the data but serializes the backing fields (so there are '__' for all the sub objects)

Hence my attempts to configure which controllers used which serializers. Thankfully I found another approach that works for my situation.


So, from my perspective, there is no point to invest time in it.

Got yeah! I appreciate you taking the time to read and share your thoughts.

from zeroql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.