Create SectionController.cs
This commit is contained in:
@@ -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<ZeroOptions> options) : base(config)
|
||||
{
|
||||
Options = options.CurrentValue;
|
||||
}
|
||||
|
||||
|
||||
public IActionResult GetAll()
|
||||
{
|
||||
return Json(Options.Sections.ToList());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user