1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Api/Extensions/NancyJsonSerializer.cs

30 lines
726 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.IO;
using Nancy;
using NzbDrone.Common;
2013-02-23 23:35:26 +03:00
namespace NzbDrone.Api.Extensions
{
public class NancyJsonSerializer : ISerializer
{
private readonly IJsonSerializer _jsonSerializer;
public NancyJsonSerializer(IJsonSerializer jsonSerializer)
{
_jsonSerializer = jsonSerializer;
}
public bool CanSerialize(string contentType)
{
return true;
}
public void Serialize<TModel>(string contentType, TModel model, Stream outputStream)
{
_jsonSerializer.Serialize(model, outputStream);
}
public IEnumerable<string> Extensions { get; private set; }
}
}