2013-01-25 11:03:28 -08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using Nancy;
|
2013-04-16 17:24:49 -07:00
|
|
|
using NzbDrone.Common;
|
2013-05-12 08:18:17 -07:00
|
|
|
using NzbDrone.Common.Serializer;
|
2013-01-25 11:03:28 -08:00
|
|
|
|
2013-02-23 12:35:26 -08:00
|
|
|
namespace NzbDrone.Api.Extensions
|
2013-01-25 11:03:28 -08:00
|
|
|
{
|
|
|
|
public class NancyJsonSerializer : ISerializer
|
|
|
|
{
|
|
|
|
public bool CanSerialize(string contentType)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Serialize<TModel>(string contentType, TModel model, Stream outputStream)
|
|
|
|
{
|
2013-05-12 19:52:55 -07:00
|
|
|
Json.Serialize(model, outputStream);
|
2013-01-25 11:03:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public IEnumerable<string> Extensions { get; private set; }
|
|
|
|
}
|
|
|
|
}
|