Skip to content

Commit

Permalink
Use object initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Jul 24, 2013
1 parent 2a04e0b commit 84c73e5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions source/Glimpse.Core/Extensibility/JsonNetSerializer.cs
Expand Up @@ -18,9 +18,15 @@ public JsonNetSerializer(ILogger logger)
{
Logger = logger;

Settings = new JsonSerializerSettings();
Settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
Settings.Converters.Add(new JsonNetConverterDictionaryKeysAreNotPropertyNames());
Settings = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
Converters =
{
new JsonNetConverterDictionaryKeysAreNotPropertyNames(),
},
};

Settings.Error += (obj, args) =>
{
Logger.Error("Error serializing object.", args.ErrorContext.Error);
Expand Down

2 comments on commit 84c73e5

@avanderhoorn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't you like the way it was ;)

@dahlbyk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No 😁

Please sign in to comment.