Boba.Settings.EntityFrameworkCore 1.0.0

dotnet add package Boba.Settings.EntityFrameworkCore --version 1.0.0
NuGet\Install-Package Boba.Settings.EntityFrameworkCore -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Boba.Settings.EntityFrameworkCore" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Boba.Settings.EntityFrameworkCore --version 1.0.0
#r "nuget: Boba.Settings.EntityFrameworkCore, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Boba.Settings.EntityFrameworkCore as a Cake Addin
#addin nuget:?package=Boba.Settings.EntityFrameworkCore&version=1.0.0

// Install Boba.Settings.EntityFrameworkCore as a Cake Tool
#tool nuget:?package=Boba.Settings.EntityFrameworkCore&version=1.0.0

Boba.Settings

Boba.Settings is a comprehensive C# library meticulously crafted to streamline the management of application and business settings within projects. Offering a suite of robust functionalities, it empowers developers to efficiently organize and access crucial configurations, thereby enhancing development workflows and ensuring seamless integration of settings across various facets of the application.

Getting Started

Installation

Boba.Settings is conveniently available on NuGet. Simply install the provider package corresponding to your target database.

dotnet add package Boba.Settings
dotnet add package Boba.Settings.EntityFrameworkCore.SqlServer

Utilize the --version option to specify a preview version for installation if needed.

Basic Usage

Harnessing the power of Boba.Settings is straightforward. Follow these steps to get started:

Registration:

Begin by registering Boba.Settings in your program.cs. Presently, we support SqlServer, necessitating the provision of a connection string. Alternative data store providers are also available.

var connectionString = builder.Configuration.GetConnectionString("ConnectionString");
builder.Services.AddBobaSettings().UseSqlServer(connectionString); 
Configuration:

Define your settings class, inheriting from ISettings. Here, you can optionally assign default values to be retrieved in the absence of stored data.

public class TestSettings : ISettings
{
    public bool Enabled { get; set; } = true;
    public int DefaultLangId { get; set; } = default!;
    public string DefaultColor { get; set; } = "Red";
}
Utilization:

Inject the setting service into your application and access the values effortlessly.

private readonly TestSettings _testSettings;
	
public YourConstructor(TestSettings testSettings)
{
    _testSettings = testSettings;
}

Console.WriteLine(_testSettings.DefaultLangId);

Additionally, settings can be loaded manually.

private readonly ISettingService _settingService;
	
public YourConstructor(ISettingService settingService)
{
    _settingService = settingService;
}

var testSettings = await _settingService.LoadSettingAsync<TestSettings>();

Console.WriteLine(testSettings.DefaultLangId);
Management:

The ISettingService interface offers a plethora of APIs for seamless management of settings. For instance, to insert settings:

private readonly ISettingService _settingService;
	
public YourConstructor(ISettingService settingService)
{
    _settingService = settingService;
}

await _settingService.SaveSettingAsync(new TestSettings { DefaultLangId = 1, Enabled = false });

Available Data Stores

Sql Server: Boba.Settings.EntityFrameworkCore.SqlServer

Upcoming Data Stores

  • Sql light
  • In Memory
  • Azure Cosmos DB SQL API
  • PostgreSQL
  • MySQL, MariaDB
  • Oracle DB 11.2 onwards
  • And more… Contributions to expand the list of supported data stores are highly encouraged.

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

Upcoming Features

  • Comprehensive unit testing capabilities.
  • Query caching mechanisms for enhanced performance.
  • Intuitive User Interface for simplified management.
  • Flexible injection options, including Windsor, Unity, Autofac, etc.
  • Support for various DB stores such as MangoDb, In Memory, Sql Light, CozmoDB.
  • Integration with app setting configurations.
  • Association of settings with entities like UserId, StoreId, etc.

Versions

The main branch is now on .NET 8.0. Previous versions are not available at this time.

License

This project is licensed under the MIT license.

Support

If you encounter any issues or have questions, please feel free to raise a new issue.

Technologies

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Boba.Settings.EntityFrameworkCore:

Package Downloads
Boba.Settings.EntityFrameworkCore.SqlServer

Simplify application and business settings management.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 80 3/29/2024