Boba.Settings 1.0.5

dotnet add package Boba.Settings --version 1.0.5                
NuGet\Install-Package Boba.Settings -Version 1.0.5                
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" Version="1.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Boba.Settings --version 1.0.5                
#r "nuget: Boba.Settings, 1.0.5"                
#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 as a Cake Addin
#addin nuget:?package=Boba.Settings&version=1.0.5

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

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 database.

Choose your data store option and follow its documentation to install the right package.

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 Sql server, InMemeory, Alternative data store providers are also available.

builder.Services.AddBobaSettings();
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

Upcoming Data Stores

  • Sql light
  • 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, Sql Light, CozmoDB.
  • Association of settings with entities like UserId, StoreId, etc.
  • Setting version

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:

Package Downloads
Boba.Settings.EntityFrameworkCore

Simplify application and business settings management.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 200 8/15/2024
1.0.4 264 8/9/2024
1.0.3 135 8/8/2024
1.0.2 143 8/8/2024
1.0.1 252 5/9/2024
1.0.0 137 3/29/2024