/localsetting

LocalSetting is a lightweight localsetting tool based on file read and write.

Primary LanguageC#MIT LicenseMIT

LocalSetting

English | δΈ­ζ–‡

πŸ“š Introduce

LocalSetting is a lightweight localsetting tool based on file read and write. The LocalSetting data is under the path provided by the system for AppData in general.

πŸ† Features

  • Free of Configuration
  • No Third Dependency
  • Based on File System & JSON
  • Simple API: Only Two Methods SaveSetting(key,T) & ReadSetting(key)
  • High Perfermance
  • DI Ready

πŸš€ Install

Install LocalSetting from the package manager console:

PM> Install-Package LocalSetting

Or from the .NET CLI as:

dotnet add package LocalSetting

πŸ”¨ Use

Declare

var settings = new LocalSetting(); 

Save a Setting

settings.SaveSetting("RepoUrl", "https://github.com/liufangchen/localsetting");

Read a Setting

var url = settings.ReadSetting<string>("RepoUrl");

Dependency Injection

services.AddSingleton<ILocalSetting, LocalSetting>();

Supported .NET SDK

  • .NET 6, 7, 8
  • .NET Standard 2.0