![]() |
VOOZH | about |
dotnet add package ServantSoftware.SettingsOnEF --version 1.0.0.41
NuGet\Install-Package ServantSoftware.SettingsOnEF -Version 1.0.0.41
<PackageReference Include="ServantSoftware.SettingsOnEF" Version="1.0.0.41" />
<PackageVersion Include="ServantSoftware.SettingsOnEF" Version="1.0.0.41" />Directory.Packages.props
<PackageReference Include="ServantSoftware.SettingsOnEF" />Project file
paket add ServantSoftware.SettingsOnEF --version 1.0.0.41
#r "nuget: ServantSoftware.SettingsOnEF, 1.0.0.41"
#:package ServantSoftware.SettingsOnEF@1.0.0.41
#addin nuget:?package=ServantSoftware.SettingsOnEF&version=1.0.0.41Install as a Cake Addin
#tool nuget:?package=ServantSoftware.SettingsOnEF&version=1.0.0.41Install as a Cake Tool
An EF Core extension for centralizing application settings in the database. Each setting class corresponds to a table, with each table having a single-row configuration.
👁 Build Status
👁 Version
👁 License
👁 Nuget
A specialized uses the JSON EF Core Provider
ServantSoftware.SettingsOnEF package via NuGet:dotnet add package ServantSoftware.SettingsOnEF
| Package Name | Release (NuGet) |
|---|---|
ServantSoftware.SettingsOnEF.Common |
👁 NuGet |
ServantSoftware.SettingsOnEF |
👁 NuGet |
namespace SettingsOnEF.Tests.Test_Classes;
[SettingsEntity]
public class SomeSetting
{
public string SomeProperty { get; set; }
}
var settingsManager = new SettingsManager(contextBuilder => contextBuilder.UseSqlite($"Data Source=InMemorySample;Mode=Memory;Cache=Shared"));
var setting = settingsManager.Get<SomeSetting>();
setting.SomeProperty = "NewValue";
settingsManager.Update(setting);
For more detailed documentation, check our Wiki.
We welcome contributions to SettingsOnEF! Here's how you can help:
Please read our for details on the process and coding standards.
SettingsOnEF leverages Entity Framework Core (EF Core) for managing application settings storage. It's important to note that DbContext, a fundamental part of EF Core, is not thread-safe. This means that instances of DbContext, and by extension, instances of SettingsManager and JsonSettingsManager provided by SettingsOnEF, should not be accessed concurrently from multiple threads.
To ensure the integrity and reliability of your application, it is the consumer's responsibility to manage the thread-safe usage of SettingsOnEF. Here are some guidelines to help you avoid common pitfalls related to threading:
Scoped Instances: In web applications, particularly those built with ASP.NET Core, utilize dependency injection to create scoped instances of SettingsManager or JsonSettingsManager. This ensures that each HTTP request receives its instance, effectively isolating individual requests from one another.
Synchronization: For applications where SettingsOnEF might be accessed concurrently in a multi-threaded scenario, implement appropriate synchronization mechanisms. For example, you can use locks, SemaphoreSlim, or other synchronization primitives to control access to SettingsOnEF instances. This is crucial for batch operations, background services, or any application part that runs in parallel threads.
Immutable Settings Patterns: Consider adopting a pattern where settings are loaded once at the beginning of an operation and treated as read-only for the duration of that operation. This approach can reduce the need for synchronization but requires a design that accommodates potentially stale settings if they are updated while the application is running.
Singleton Pattern: Avoid using a single, application-wide instance of SettingsManager or JsonSettingsManager without proper synchronization, as this can lead to data corruption and concurrency exceptions.
Static Access: Similarly, static methods or properties that internally use a shared DbContext instance should be avoided unless they are designed to handle concurrent access securely.
By adhering to these guidelines and designing your application with thread safety in mind, you can effectively mitigate concurrency-related issues while using SettingsOnEF. Remember, managing thread safety is a shared responsibility between the library and its consumers. If your application scenario requires concurrent access to SettingsOnEF, planning and implementing a thread-safe strategy is essential for maintaining data integrity and application stability.
Feel free to submit issues and enhancement requests.
SettingsOnEF is licensed under the MIT License. See for more information.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on ServantSoftware.SettingsOnEF:
| Package | Downloads |
|---|---|
|
ServantSoftware.SettingsOnEF.Json
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.41 | 262 | 6/7/2024 |
| 1.0.0.40 | 272 | 3/27/2024 |
| 1.0.0.39 | 268 | 3/17/2024 |
| 1.0.0.38 | 274 | 3/16/2024 |
| 1.0.0.36 | 340 | 11/21/2023 |
| 1.0.0.35 | 330 | 10/24/2023 |
| 1.0.0.34 | 266 | 10/23/2023 |
| 1.0.0.33 | 237 | 10/23/2023 |
| 1.0.0.32 | 242 | 10/23/2023 |
| 1.0.0.31 | 251 | 10/23/2023 |
| 1.0.0.30 | 240 | 10/23/2023 |
| 1.0.0.29 | 240 | 10/23/2023 |
| 1.0.0.28 | 262 | 10/23/2023 |
| 1.0.0.27 | 232 | 10/23/2023 |
| 1.0.0.26 | 233 | 10/23/2023 |
| 1.0.0.25 | 233 | 10/10/2023 |
| 1.0.0.24 | 239 | 10/8/2023 |
| 1.0.0.23 | 249 | 10/8/2023 |
| 1.0.0.22 | 256 | 9/27/2023 |
| 1.0.0.21 | 256 | 9/27/2023 |