wiredup db logging.

This commit is contained in:
kay.one 2013-05-20 20:20:29 -07:00
commit af4063c3e2
6 changed files with 31 additions and 6 deletions

View file

@ -16,11 +16,17 @@ namespace NzbDrone.Api.Extensions
}
public static T FromJson<T>(this Stream body, Type type)
{
return (T)FromJson(body, type);
}
public static object FromJson(this Stream body, Type type)
{
var reader = new StreamReader(body, true);
body.Position = 0;
var value = reader.ReadToEnd();
return (T)Json.Deserialize(value, type);
return Json.Deserialize(value, type);
}
public static JsonResponse<TModel> AsResponse<TModel>(this TModel model, HttpStatusCode statusCode = HttpStatusCode.OK)