MakoIoT.Device.Services.Configuration
1.0.62.51969
dotnet add package MakoIoT.Device.Services.Configuration --version 1.0.62.51969
NuGet\Install-Package MakoIoT.Device.Services.Configuration -Version 1.0.62.51969
<PackageReference Include="MakoIoT.Device.Services.Configuration" Version="1.0.62.51969" />
paket add MakoIoT.Device.Services.Configuration --version 1.0.62.51969
#r "nuget: MakoIoT.Device.Services.Configuration, 1.0.62.51969"
// Install MakoIoT.Device.Services.Configuration as a Cake Addin #addin nuget:?package=MakoIoT.Device.Services.Configuration&version=1.0.62.51969 // Install MakoIoT.Device.Services.Configuration as a Cake Tool #tool nuget:?package=MakoIoT.Device.Services.Configuration&version=1.0.62.51969
Mako-IoT.Device.Services.Configuration
Provides easy way of reading and updating configuration settings with strongly-typed objects. Settings are stored in persistent storage via IStorageService.
Usage
Create class for your settings. You may use multiple classes, one for every component. Provide section name as static/const string.
public class MyAppConfig
{
public string ApiUrl { get; set; }
public string SslCertificate { get; set; }
public string Timezone { get; set; }
public static string SectionName => "MyAppConfig";
}
Use IConfigurationService to read and/or update settings.
public class MyAppService : IMyAppService
{
private readonly MyAppConfig _config;
public MyAppService(IConfigurationService configService)
{
_config = (MyAppService)configService.GetConfigSection(MyAppService.SectionName, typeof(MyAppService));
}
//[...]
}
Add Configuration and FileStorage components in your device builder. You can specify default settings, which will be written on startup.
public class Program
{
public static void Main()
{
DeviceBuilder.Create()
.AddConfiguration(c =>
{
c.WriteDefault(MyAppConfig.SectionName, new MyAppConfig
{
ApiUrl = "http://my-app.my-company.com/api"
});
})
.AddFileStorage()
.Build()
.Start();
Thread.Sleep(Timeout.InfiniteTimeSpan);
}
}
Note: setting overwrite = true in the WriteDefault will overwrite settings with the defaults every time (even if settings already exist).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- MakoIoT.Device.Services.Interface (>= 1.0.48.22567)
- nanoFramework.CoreLibrary (>= 1.15.5)
- nanoFramework.DependencyInjection (>= 1.1.11)
- nanoFramework.Json (>= 2.2.152)
- nanoFramework.System.Collections (>= 1.5.45)
- nanoFramework.System.IO.Streams (>= 1.1.59)
- nanoFramework.System.Text (>= 1.2.54)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on MakoIoT.Device.Services.Configuration:
Package | Downloads |
---|---|
MakoIoT.Device.Services.ConfigurationManager
Configuration mode manager for MAKO-IoT |
|
MakoIoT.Device.Services.ConfigurationApi
REST API for configuration with MAKO-IoT |
|
MakoIoT.Device.Platform.LocalConfig
MAKO-IoT Platform local configuration library. On-device web server, WiFi AP |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.62.51969 | 72 | 11/28/2024 |
1.0.61.54678 | 105 | 11/26/2024 |
1.0.60.53758 | 87 | 11/25/2024 |
1.0.59.12833 | 350 | 11/19/2024 |
1.0.58.59368 | 365 | 10/31/2024 |
1.0.57.55232 | 568 | 10/18/2024 |
1.0.56.46476 | 225 | 10/16/2024 |
1.0.55.40619 | 320 | 9/30/2024 |
1.0.54.20410 | 250 | 9/26/2024 |
1.0.53.22614 | 352 | 9/20/2024 |
1.0.52.61265 | 429 | 9/12/2024 |
1.0.51.5543 | 326 | 9/5/2024 |
1.0.50.16692 | 334 | 8/27/2024 |
1.0.49.30436 | 450 | 8/10/2024 |
1.0.48.44460 | 249 | 8/5/2024 |
1.0.47.11163 | 715 | 6/12/2024 |
1.0.46.22575 | 937 | 5/18/2024 |
1.0.45.29329 | 161 | 5/17/2024 |
1.0.44.911 | 1,264 | 4/9/2024 |
1.0.43.25265 | 226 | 4/8/2024 |
1.0.42.31032 | 416 | 4/3/2024 |
1.0.41.11032 | 437 | 3/23/2024 |
1.0.40.13779 | 317 | 3/21/2024 |
1.0.39.3446 | 2,064 | 1/6/2024 |
1.0.38.57711 | 451 | 12/30/2023 |
1.0.37.47513 | 254 | 12/30/2023 |
1.0.36.62303 | 879 | 12/2/2023 |
1.0.35.24200 | 274 | 12/1/2023 |
1.0.34.49211 | 513 | 11/17/2023 |
1.0.33.44373 | 309 | 11/16/2023 |
1.0.32.19851 | 453 | 11/12/2023 |
1.0.31.51806 | 1,363 | 10/9/2023 |
1.0.30.25325 | 451 | 10/6/2023 |
1.0.29.64214 | 364 | 10/4/2023 |
1.0.27.26144 | 1,061 | 5/29/2023 |
1.0.25.42009 | 485 | 5/25/2023 |
1.0.24.48276 | 333 | 5/25/2023 |
1.0.21.23813 | 139 | 5/22/2023 |
1.0.20.48349 | 346 | 5/22/2023 |