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.
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
if (m == null || m.DeviceProfile == null)
|
||||
throw new ArgumentException("Invalid Device Profile Id", "id");
|
||||
|
||||
m.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses;
|
||||
m.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
|
||||
|
||||
if (m.DeviceProfile.DefaultOrganisationAddress.HasValue)
|
||||
m.DefaultOrganisationAddress = Database.DiscoConfiguration.OrganisationAddresses.GetAddress(m.DeviceProfile.DefaultOrganisationAddress.Value);
|
||||
|
||||
Reference in New Issue
Block a user