Skip to content

Instantly share code, notes, and snippets.

@ssougnez
Created July 8, 2018 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/d2d9e15f955167190e36187c25f200a9 to your computer and use it in GitHub Desktop.
Save ssougnez/d2d9e15f955167190e36187c25f200a9 to your computer and use it in GitHub Desktop.
namespace AnotherDevBlog.Core.API
{
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Web.Http.Results;
using Umbraco.Web.WebApi;
public class CustomDataController : UmbracoApiController
{
public JsonResult<string[]> GetData()
{
return Json(new[] { "One", "Two", "Three", "Four", "Five" }, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment