English | δΈζ
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.
- 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 LocalSetting from the package manager console:
PM> Install-Package LocalSetting
Or from the .NET CLI as:
dotnet add package LocalSetting
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>();
- .NET 6, 7, 8
- .NET Standard 2.0