Skip to content

Instantly share code, notes, and snippets.

@Adolfi
Created March 28, 2022 08:22
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 Adolfi/a54badc4428d096f8e7e957f923c3a97 to your computer and use it in GitHub Desktop.
Save Adolfi/a54badc4428d096f8e7e957f923c3a97 to your computer and use it in GitHub Desktop.
public class ProductsController : UmbracoApiController
{
public IEnumerable<string> GetAllProducts()
{
return new[] { "Table", "Chair", "Desk", "Computer", "Beer fridge" };
}
[HttpGet]
public JsonResult GetAllProductsJson()
{
return new JsonResult(this.GetAllProducts());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment