Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supporting camel case property names in SignalR V 2.0

Tags:

c#

signalr

Im looking to upgrade our project to SignalR 2.0 from 1.0. One issue I have come across is that IJsonSerializer seems to have been removed in 2.0. I was previously using it to change the ContractResolver and have property names in camel case. (see https://github.com/SignalR/SignalR/issues/500#issuecomment-7453751 and code below)

Is there any way to replicate this functionality in 2.0 without the IJsonSerializer interface?

var settings = new JsonSerializerSettings();
settings.ContractResolver = new SignalRContractResolver();

var serializer = new JsonNetSerializer(settings);
GlobalHost.DependencyResolver.Register(typeof(IJsonSerializer), ()=>serializer);
like image 741
Tom Squires Avatar asked Nov 02 '22 13:11

Tom Squires


1 Answers

This was a bug with the RC which has now been fixed. See https://github.com/SignalR/SignalR/issues/500#issuecomment-25580534

like image 148
Tom Squires Avatar answered Nov 15 '22 05:11

Tom Squires