qol: remove this
This commit is contained in:
@@ -28,17 +28,17 @@ namespace Disco.Data.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return ConfigurationCache.GetScopeKeys(Database, this.Scope);
|
||||
return ConfigurationCache.GetScopeKeys(Database, Scope);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetValue<T>(string Key, T Value)
|
||||
{
|
||||
ConfigurationCache.Helpers<T>.SetValue(Database, this.Scope, Key, Value);
|
||||
ConfigurationCache.Helpers<T>.SetValue(Database, Scope, Key, Value);
|
||||
}
|
||||
private T GetValue<T>(string Key, T Default)
|
||||
{
|
||||
return ConfigurationCache.Helpers<T>.GetValue(Database, this.Scope, Key, Default);
|
||||
return ConfigurationCache.Helpers<T>.GetValue(Database, Scope, Key, Default);
|
||||
}
|
||||
|
||||
protected void Set<T>(T Value, [CallerMemberName] string Key = null)
|
||||
@@ -46,7 +46,7 @@ namespace Disco.Data.Configuration
|
||||
if (Key == null)
|
||||
throw new ArgumentNullException("Key");
|
||||
|
||||
this.SetValue(Key, Value);
|
||||
SetValue(Key, Value);
|
||||
}
|
||||
|
||||
protected T Get<T>(T Default, [CallerMemberName] string Key = null)
|
||||
@@ -54,17 +54,17 @@ namespace Disco.Data.Configuration
|
||||
if (Key == null)
|
||||
throw new ArgumentNullException("Key");
|
||||
|
||||
return this.GetValue(Key, Default);
|
||||
return GetValue(Key, Default);
|
||||
}
|
||||
|
||||
protected void SetObsfucated(string Value, [CallerMemberName] string Key = null)
|
||||
{
|
||||
this.Set(Value.Obsfucate(), Key);
|
||||
Set(Value.Obsfucate(), Key);
|
||||
}
|
||||
|
||||
protected string GetDeobsfucated(string Default, [CallerMemberName] string Key = null)
|
||||
{
|
||||
var obsfucatedValue = this.Get<string>(null, Key);
|
||||
var obsfucatedValue = Get<string>(null, Key);
|
||||
|
||||
if (obsfucatedValue == null)
|
||||
return Default;
|
||||
@@ -74,35 +74,35 @@ namespace Disco.Data.Configuration
|
||||
|
||||
protected void RemoveScope()
|
||||
{
|
||||
ConfigurationCache.RemoveScope(Database, this.Scope);
|
||||
ConfigurationCache.RemoveScope(Database, Scope);
|
||||
}
|
||||
|
||||
protected void RemoveItem(string Key)
|
||||
{
|
||||
ConfigurationCache.RemoveScopeKey(Database, this.Scope, Key);
|
||||
ConfigurationCache.RemoveScopeKey(Database, Scope, Key);
|
||||
}
|
||||
|
||||
[Obsolete("Types are automatically serialized/deserialized if required, use Set<T>(T Value) instead.")]
|
||||
protected void SetAsJson<T>(T Value, [CallerMemberName] string Key = null)
|
||||
{
|
||||
this.Set(Value, Key);
|
||||
Set(Value, Key);
|
||||
}
|
||||
|
||||
[Obsolete("Types are automatically serialized/deserialized if required, use Get<T>(T Default) instead.")]
|
||||
protected T GetFromJson<T>(T Default, [CallerMemberName] string Key = null)
|
||||
{
|
||||
return this.Get(Default, Key);
|
||||
return Get(Default, Key);
|
||||
}
|
||||
|
||||
[Obsolete("Types are automatically serialized/deserialized if required, use Set<T>(T Value) instead.")]
|
||||
protected void SetAsEnum<T>(T Value, [CallerMemberName] string Key = null)
|
||||
{
|
||||
this.Set(Value, Key);
|
||||
Set(Value, Key);
|
||||
}
|
||||
[Obsolete("Types are automatically serialized/deserialized if required, use Set<T>(T Value) instead.")]
|
||||
protected T GetFromEnum<T>(T Default, [CallerMemberName] string Key = null)
|
||||
{
|
||||
return this.Get(Default, Key);
|
||||
return Get(Default, Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Disco.Data.Configuration.Modules
|
||||
{
|
||||
get
|
||||
{
|
||||
var v = this.Get(1);
|
||||
var v = Get(1);
|
||||
if (v > 0)
|
||||
return v;
|
||||
else
|
||||
@@ -24,21 +24,21 @@ namespace Disco.Data.Configuration.Modules
|
||||
if (value < 1)
|
||||
throw new ArgumentOutOfRangeException("value", "Expected >= 1");
|
||||
|
||||
this.Set(value);
|
||||
Set(value);
|
||||
}
|
||||
}
|
||||
public int DefaultAddDeviceOfflineDeviceProfileId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Get(0);
|
||||
return Get(0);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
throw new ArgumentOutOfRangeException("value", "Expected >= 0");
|
||||
|
||||
this.Set(value);
|
||||
Set(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Disco.Data.Repository
|
||||
|
||||
public DiscoDataContext()
|
||||
{
|
||||
this._Configuration = new Lazy<Configuration.SystemConfiguration>(() => new Configuration.SystemConfiguration(this));
|
||||
_Configuration = new Lazy<Configuration.SystemConfiguration>(() => new Configuration.SystemConfiguration(this));
|
||||
}
|
||||
|
||||
public virtual DbSet<ConfigurationItem> ConfigurationItems { get; set; }
|
||||
@@ -60,7 +60,7 @@ namespace Disco.Data.Repository
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Configuration.Value;
|
||||
return _Configuration.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ namespace Disco.Data.Repository
|
||||
|
||||
public DiscoDatabaseConnectionFactory(IDbConnectionFactory Default)
|
||||
{
|
||||
this.DefaultConnectionFactory = Default;
|
||||
this.SqlCeConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
|
||||
DefaultConnectionFactory = Default;
|
||||
SqlCeConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
|
||||
}
|
||||
|
||||
public DbConnection CreateConnection(string nameOrConnectionString)
|
||||
|
||||
Reference in New Issue
Block a user