Code Monkey home page Code Monkey logo

Comments (4)

nojaf avatar nojaf commented on June 15, 2024 1

Thanks, I got it working:

    let jsonMessageFormatter = new JsonMessageFormatter ()
    do jsonMessageFormatter.JsonSerializer.ContractResolver <- DefaultContractResolver(NamingStrategy = CamelCaseNamingStrategy())
    let handler = new HeaderDelimitedMessageHandler (sender, reader, jsonMessageFormatter)
    let rpc : JsonRpc = new JsonRpc(handler, this)
    do rpc.StartListening()

from vs-streamjsonrpc.

AArnott avatar AArnott commented on June 15, 2024

Is there any reason you don't do this?

-        task { return { Message = "And dotnet will answer" } }
+        task { return { message = "And dotnet will answer" } }

from vs-streamjsonrpc.

nojaf avatar nojaf commented on June 15, 2024

Properties in dotnet aren't typically lowercase. So, it is a bit of a habit I suppose.
If the easy answer is just to write lowercase properties, then that is a sufficient answer for me.
I just assumed it might be configurable somehow.

from vs-streamjsonrpc.

AArnott avatar AArnott commented on June 15, 2024

It is configurable. But not at the StreamJsonRpc level. You'd have to tell your serializer of choice (Newtonsoft.Json in this case) that you want to do it. StreamJsonRpc exposes the APIs necessary for you to do this. You'll have to instantiate a JsonMessageFormatter yourself, then use its properties to set the Newtonsoft.Json settings to automatically change the naming convention. Then use that formatter in a handler that you then pass to the JsonRpc you create. So your one JsonRpc.Attach line of code will become 3-5 lines. But then, all the property names will adjust automatically.

from vs-streamjsonrpc.

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.