ZimLabs.Settings.Sqlite 1.0.0

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

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

ZimLabs.Settings.Sqlite

Content

General

Nuget GitHub release (latest by date)

For more information click here: ZimLabs.Database.MySql

This library provides functions to manage settings using a SQLite database.

The settings are stored as a "Key" - "Value" pair.

Example

Here a small example

// Using
using ZimLabs.Settings.Sqlite;

var settingsManager = new SettingsManager("NameOfMyDatabase");

// Add an entry
var entry = await settingsManager.AddEntryAsync(1, "TheValue", "Some description");

// Add another entry
// Note: If you specify an id, it will be removed during the add process
var secondEntry = await settingsManager.AddEntryAsync(new SettingsEntry
{
    Key = 1,
    Value = "10",
    Description = "Some description"
});

// Update an entry
secondEntry.Value = "100";
await settingsManager.UpdateEntryAsync(secondEntry);

// Update the first entry
await settingsManager.UpdateEntryAsync(1, "NewValue");

// Delete an entry
await settingsManager.DeleteEntryAsync(1);

// Load all entries
var entries = await settingsManager.LoadAsync();

// Load the entry with the key "2"
var tmpEntry = await settingsManager.LoadEntryAsync(2);

// Load the value of the second entry
var tmpValue = await settingsManager.LoadValueAsync(2);

// Load the value of the second entry and convert it into an int
var tmpValueInt = await settingsManager.LoadValueAsync<int>(2);

For more examples see the Demo project.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 243 2/28/2023