From 69637f48fc9d8eb516e4bfb839b84cd52b233f92 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Sun, 5 Apr 2020 00:54:18 +0200 Subject: [PATCH] Create SectionController.cs --- zero.Web/Controllers/SectionController.cs | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 zero.Web/Controllers/SectionController.cs diff --git a/zero.Web/Controllers/SectionController.cs b/zero.Web/Controllers/SectionController.cs new file mode 100644 index 00000000..1687736c --- /dev/null +++ b/zero.Web/Controllers/SectionController.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using System.Linq; +using zero.Core; + +namespace zero.Web.Controllers +{ + [AllowAnonymous] + public class SectionController : BackofficeController + { + private ZeroOptions Options { get; set; } + + public SectionController(IZeroConfiguration config, IOptionsMonitor options) : base(config) + { + Options = options.CurrentValue; + } + + + public IActionResult GetAll() + { + return Json(Options.Sections.ToList()); + } + } +}