Skip to content

Instantly share code, notes, and snippets.

@Adolfi
Created March 28, 2022 08:22
Embed
What would you like to do?
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