-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a8d1b6
commit 8c437c8
Showing
8 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
TrackerDog/Serialization/Json/CustomObjectContractResolver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json.Serialization; | ||
using System; | ||
using System.Dynamic; | ||
|
||
namespace TrackerDog.Serialization.Json | ||
{ | ||
internal class CustomObjectContractResolver : CamelCasePropertyNamesContractResolver | ||
{ | ||
protected override JsonContract CreateContract(Type objectType) | ||
{ | ||
if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(objectType)) | ||
{ | ||
return CreateObjectContract(objectType); | ||
} | ||
|
||
return base.CreateContract(objectType); | ||
} | ||
|
||
protected override JsonDictionaryContract CreateDictionaryContract(Type objectType) | ||
{ | ||
JsonDictionaryContract contract = base.CreateDictionaryContract(objectType); | ||
|
||
contract.DictionaryKeyResolver = propertyName => propertyName; | ||
|
||
return contract; | ||
} | ||
} | ||
} |
23 changes: 0 additions & 23 deletions
23
TrackerDog/Serialization/Json/DynamicObjectContractResolver.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters