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:
Gary Sharp
2014-05-07 22:45:59 +10:00
parent 6b2cd47610
commit fb6067afc3
19 changed files with 455 additions and 282 deletions
@@ -1,9 +1,5 @@
using Disco.Data.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Data.Configuration.Modules
{
@@ -20,18 +16,18 @@ namespace Disco.Data.Configuration.Modules
{
get
{
return GetFromJson<Dictionary<string, List<string>>>(null);
return Get<Dictionary<string, List<string>>>(null);
}
set
{
SetAsJson(value);
Set(value);
}
}
public bool? SearchAllForestServers
{
get { return GetFromJson<bool?>(null); }
set { SetAsJson(value); }
get { return Get<bool?>(null); }
set { Set(value); }
}
}
}