Your design serializes twice. First, an object is converted to JSON. Next, the JSON is converted to a string.
The standard pattern in MVC 5 (.NET Framework) is defining a ActionResult return type and simply returning a type and letting the framework serialize the type. I believe MVC 5 uses Newtonsoft by default.
namespace MvcDemo.Controllers
{
public class ViewModel
{
public string Message { get; set; }
}
public class HomeController : Controller
{
[HttpGet]
public ActionResult Index()
{
ViewModel model = new ViewModel() { Message = "Hello world" };
return Json(model, JsonRequestBehavior.AllowGet);
}
}
}
I recommend Web API rather than MVC for returning JSON.