Thank you for clarifying those aspects, my idea was to implement a mechanism to store some of the settings (e.g. server/Web Service URLs, port numbers, common prefixes) in the database in order to avoid to hardcode them.
I though that something like:
SettingDefinition("CustomSetting1", "TestValue1", scopes: SettingScopes.Application),
Would/could have created an entry in the database with CustomSetting1 as the key and TestValue1 as the corresponding value. It's not hard to implement a mechanism like that from scratch, but I was wondering if ASP.NET Boilerplate already provides that kind of features.
I'd use it mainly to store values [by module / by application... not by user] that I don't want to hardcode.
Hi,
after reading <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Setting-Management">http://www.aspnetboilerplate.com/Pages/ ... Management</a> it is not clear to me how to store settings in a dbcontext.
I have a context created using the Module-Zero migrations and the following code:
Configuration.Settings.Providers.Add<AppSettingProvider>();
public class AppSettingProvider : SettingProvider { public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context) { return new List<SettingDefinition> { new SettingDefinition("CustomSetting1", "TestValue1", scopes: SettingScopes.Application), new SettingDefinition("CustomSetting2", "TestValue2", scopes: SettingScopes.Application) }; } }
How can I store those settings in the database?
Thanks