Files
Disco/Disco.Web/Areas/Config/Controllers/OrganisationController.cs
Gary Sharp fb6067afc3 Update: Configuration Optimisation and Caching
Loads entire configuration at start-up (rather than scope-based
loading). Deserialization occurs once, with the resulting value cached
and replayed if the requested type matches.
2014-05-07 22:45:59 +10:00

32 lines
1.0 KiB
C#

using Disco.Models.UI.Config.Organisation;
using Disco.Services.Authorization;
using Disco.Services.Plugins.Features.UIExtension;
using Disco.Services.Web;
using System.Linq;
using System.Web.Mvc;
namespace Disco.Web.Areas.Config.Controllers
{
public partial class OrganisationController : AuthorizedDatabaseController
{
//
// GET: /Config/Organisation/
[DiscoAuthorize(Claims.Config.Organisation.Show)]
public virtual ActionResult Index()
{
var viewModel = new Models.Organisation.IndexModel();
viewModel.OrganisationName = Database.DiscoConfiguration.OrganisationName;
viewModel.MultiSiteMode = Database.DiscoConfiguration.MultiSiteMode;
viewModel.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
// UI Extensions
UIExtensions.ExecuteExtensions<ConfigOrganisationIndexModel>(this.ControllerContext, viewModel);
return View(viewModel);
}
}
}