1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-19 21:46:50 -04:00

New: Use System.Text.Json for Nancy and SignalR

This commit is contained in:
ta264
2021-02-03 21:20:06 +00:00
committed by Qstick
parent e623efefd3
commit f03dfda2f0
42 changed files with 285 additions and 89 deletions
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using Nancy;
@@ -27,10 +27,8 @@ namespace Radarr.Http.Extensions
public static object FromJson(this Stream body, Type type)
{
var reader = new StreamReader(body, true);
body.Position = 0;
var value = reader.ReadToEnd();
return Json.Deserialize(value, type);
return STJson.Deserialize(body, type);
}
public static JsonResponse<TModel> AsResponse<TModel>(this TModel model, NancyContext context, HttpStatusCode statusCode = HttpStatusCode.OK)