summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-07 16:36:44 -0400
committerMichael <[email protected]>2017-04-07 16:36:44 -0400
commit1de8bc4bd0af72646ed58ecd7619a8731c48b09d (patch)
treee9ae8f7b372d63ee6b40b4b7115eeb33f999d26a /Project-Unite/Controllers
parent556fe967ae3f91f6c617e9fb0f317178c66a5053 (diff)
downloadproject-unite-1de8bc4bd0af72646ed58ecd7619a8731c48b09d.tar.gz
project-unite-1de8bc4bd0af72646ed58ecd7619a8731c48b09d.tar.bz2
project-unite-1de8bc4bd0af72646ed58ecd7619a8731c48b09d.zip
use .net serializer rather than json.net
Diffstat (limited to 'Project-Unite/Controllers')
-rw-r--r--Project-Unite/Controllers/APIController.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/Project-Unite/Controllers/APIController.cs b/Project-Unite/Controllers/APIController.cs
index 1a71209..286b4f4 100644
--- a/Project-Unite/Controllers/APIController.cs
+++ b/Project-Unite/Controllers/APIController.cs
@@ -3,13 +3,24 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
-using Newtonsoft.Json;
+using System.Web.Script.Serialization;
using Project_Unite.Models;
namespace Project_Unite.Controllers
{
public class APIController : Controller
{
+ public JavaScriptSerializer Serializer
+ {
+ get; set;
+ }
+ //I'll put those curly braces on their own line just to piss a certain smiley off.
+
+ public APIController()
+ {
+ Serializer = new JavaScriptSerializer();
+ }
+
// GET: API
public ActionResult Index()
{
@@ -26,13 +37,13 @@ namespace Project_Unite.Controllers
if (!showObsolete)
releases = releases.Where(x => x.Obsolete == false).ToArray();
- return Content(JsonConvert.SerializeObject(releases));
+ return Content(Serializer.Serialize(releases));
}
public ActionResult Skins()
{
var db = new ApplicationDbContext();
- return Content(JsonConvert.SerializeObject(db.Skins.ToArray()));
+ return Content(Serializer.Serialize(db.Skins.ToArray()));
}
}
} \ No newline at end of file