mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 22:25:12 +00:00
26 lines
752 B
C#
26 lines
752 B
C#
namespace Octokit.Http
|
|
{
|
|
public class SimpleJsonSerializer : IJsonSerializer
|
|
{
|
|
readonly GitHubSerializerStrategy _serializationStrategy = new GitHubSerializerStrategy();
|
|
|
|
public string Serialize(object item)
|
|
{
|
|
return SimpleJson.SerializeObject(item, _serializationStrategy);
|
|
}
|
|
|
|
public T Deserialize<T>(string json)
|
|
{
|
|
return SimpleJson.DeserializeObject<T>(json, _serializationStrategy);
|
|
}
|
|
|
|
class GitHubSerializerStrategy : PocoJsonSerializerStrategy
|
|
{
|
|
protected override string MapClrMemberNameToJsonFieldName(string clrPropertyName)
|
|
{
|
|
return clrPropertyName.ToRubyCase();
|
|
}
|
|
}
|
|
}
|
|
}
|