Easy.Net.Starter
1.0.2
See the version list below for details.
dotnet add package Easy.Net.Starter --version 1.0.2
NuGet\Install-Package Easy.Net.Starter -Version 1.0.2
<PackageReference Include="Easy.Net.Starter" Version="1.0.2" />
<PackageVersion Include="Easy.Net.Starter" Version="1.0.2" />
<PackageReference Include="Easy.Net.Starter" />
paket add Easy.Net.Starter --version 1.0.2
#r "nuget: Easy.Net.Starter, 1.0.2"
#:package Easy.Net.Starter@1.0.2
#addin nuget:?package=Easy.Net.Starter&version=1.0.2
#tool nuget:?package=Easy.Net.Starter&version=1.0.2
ConfigurationLibrary
ConfigurationLibrary est une bibliothèque .NET conçue pour simplifier la configuration des applications Console et API. Elle offre une solution facile et intuitive pour gérer :
- La configuration via des fichiers
appsettings.json. - La gestion centralisée des logs.
- L'initialisation rapide de la configuration pour différents environnements.
Fonctionnalités
- Support de
appsettings.json: Chargement et gestion des configurations via JSON avec support des sections hiérarchiques. - Gestion des environnements : Configure automatiquement les environnements (
Development,Production, etc.). - Intégration des logs : Prise en charge de la journalisation via
ILoggeravec une configuration simplifiée pourConsole,Fileou tout autre fournisseur. - Extension facile : Ajoutez vos propres paramètres personnalisés grâce à des mécanismes d’injection de dépendances.
Installation
Ajoutez ConfigurationLibrary à votre projet via NuGet :
Install-Package ConfigurationLibrary
Ou via la CLI .NET :
dotnet add package ConfigurationLibrary
Utilisation
1. Initialisation dans une Application Console
Ajoutez et configurez appsettings.json :
{
"AppSettings": {
"Setting1": "Valeur1",
"Setting2": "Valeur2"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning"
}
}
}
Exemple de configuration dans Program.cs :
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
class Program
{
static void Main(string[] args)
{
// ConfigurationBuilder pour charger appsettings.json
var configuration = new ConfigurationBuilder()
.SetBasePath(AppContext.BaseDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build();
// Configuration des services et des logs
var serviceCollection = new ServiceCollection()
.AddLogging(builder =>
{
builder.AddConsole();
builder.AddConfiguration(configuration.GetSection("Logging"));
})
.AddSingleton<IConfiguration>(configuration);
var serviceProvider = serviceCollection.BuildServiceProvider();
// Exemple d'utilisation de la configuration et des logs
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
var setting1 = configuration["AppSettings:Setting1"];
logger.LogInformation($"Setting1: {setting1}");
}
}
2. Initialisation dans une API ASP.NET Core
Ajoutez ConfigurationLibrary pour configurer les logs et fichiers de configuration dans Program.cs :
var builder = WebApplication.CreateBuilder(args);
// Configuration des logs et de appsettings.json
builder.Host.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
})
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();
Contribution
Les contributions sont les bienvenues ! Si vous souhaitez signaler un bug ou proposer une nouvelle fonctionnalité :
- Forkez le repository.
- Créez une branche pour votre fonctionnalité ou correctif (
git checkout -b feature/nouvelle-fonctionnalite). - Effectuez vos modifications.
- Créez une Pull Request.
Licence
Ce projet est sous licence MIT.
Avenir du Projet
Nous prévoyons d’ajouter prochainement :
- Support des configurations via des sources distantes (par exemple, Azure App Configuration).
- Intégration avec d'autres bibliothèques populaires comme Serilog et NLog.
- Plus d'exemples d'utilisation dans divers scénarios.
Auteur
VotreNom
Pour toute question ou demande, n'hésitez pas à me contacter.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- EFCore.NamingConventions (>= 8.0.3)
- Microsoft.AspNetCore.OpenApi (>= 9.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.1)
- Microsoft.Extensions.Configuration (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.Logging (>= 9.0.0)
- Newtonsoft.Json (>= 13.0.3)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.0)
- Scalar.AspNetCore (>= 1.2.70)
- Serilog (>= 4.2.0)
- Serilog.AspNetCore (>= 9.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Extensions.Hosting (>= 9.0.0)
- Serilog.Extensions.Logging (>= 9.0.0)
- Serilog.Formatting.Compact (>= 3.0.0)
- Serilog.Settings.Configuration (>= 9.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.Debug (>= 3.0.0)
- Serilog.Sinks.File (>= 6.0.0)
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 |
|---|---|---|
| 9.6.4 | 150 | 5/10/2025 |
| 9.6.3 | 132 | 5/10/2025 |
| 9.6.2 | 257 | 4/23/2025 |
| 9.6.1 | 248 | 4/23/2025 |
| 9.6.0 | 236 | 4/23/2025 |
| 9.4.22 | 204 | 3/31/2025 |
| 9.4.21 | 215 | 3/31/2025 |
| 9.4.20 | 223 | 3/31/2025 |
| 9.4.19 | 203 | 3/30/2025 |
| 9.4.18 | 214 | 3/30/2025 |
| 9.4.17 | 212 | 3/30/2025 |
| 9.4.16 | 220 | 3/30/2025 |
| 9.4.15 | 187 | 3/30/2025 |
| 9.4.14 | 212 | 3/30/2025 |
| 9.4.13 | 207 | 3/30/2025 |
| 9.4.12 | 209 | 3/30/2025 |
| 9.4.11 | 226 | 3/30/2025 |
| 9.4.10 | 209 | 3/30/2025 |
| 9.4.9 | 209 | 3/30/2025 |
| 9.4.8 | 229 | 3/30/2025 |
| 9.4.7 | 220 | 3/30/2025 |
| 9.4.6 | 164 | 3/29/2025 |
| 9.4.5 | 176 | 3/29/2025 |
| 9.4.4 | 170 | 3/29/2025 |
| 9.4.3 | 163 | 3/29/2025 |
| 9.4.1 | 167 | 3/29/2025 |
| 9.4.0 | 162 | 3/29/2025 |
| 9.3.4 | 184 | 3/26/2025 |
| 9.3.3 | 213 | 3/26/2025 |
| 9.3.2 | 210 | 3/26/2025 |
| 9.3.1 | 203 | 3/26/2025 |
| 9.3.0 | 208 | 3/26/2025 |
| 9.2.18 | 550 | 3/25/2025 |
| 9.2.17 | 189 | 2/23/2025 |
| 9.2.16 | 178 | 2/22/2025 |
| 9.2.15 | 172 | 2/22/2025 |
| 9.2.14 | 190 | 2/19/2025 |
| 9.2.13 | 184 | 2/19/2025 |
| 9.2.12 | 181 | 2/16/2025 |
| 9.2.11 | 176 | 2/16/2025 |
| 9.2.10 | 187 | 2/15/2025 |
| 9.2.9 | 183 | 2/14/2025 |
| 9.2.8 | 171 | 2/14/2025 |
| 9.2.7 | 157 | 2/14/2025 |
| 9.2.6 | 164 | 2/14/2025 |
| 9.2.5 | 170 | 2/14/2025 |
| 9.2.4 | 172 | 2/14/2025 |
| 9.2.3 | 179 | 2/13/2025 |
| 9.2.2 | 180 | 2/13/2025 |
| 9.2.1 | 176 | 2/13/2025 |
| 9.2.0 | 174 | 2/13/2025 |
| 9.1.8 | 179 | 2/13/2025 |
| 9.1.7 | 184 | 2/9/2025 |
| 9.1.6 | 181 | 2/9/2025 |
| 9.1.5 | 186 | 2/9/2025 |
| 9.1.4 | 180 | 2/1/2025 |
| 9.1.3 | 164 | 2/1/2025 |
| 9.1.2 | 176 | 2/1/2025 |
| 9.1.1 | 169 | 2/1/2025 |
| 9.1.0 | 172 | 2/1/2025 |
| 9.0.34 | 158 | 1/6/2025 |
| 9.0.33 | 203 | 1/3/2025 |
| 9.0.32 | 192 | 1/3/2025 |
| 9.0.31 | 213 | 1/3/2025 |
| 9.0.30 | 183 | 1/3/2025 |
| 9.0.29 | 199 | 1/2/2025 |
| 9.0.28 | 194 | 1/2/2025 |
| 9.0.27 | 194 | 1/2/2025 |
| 9.0.26 | 179 | 1/2/2025 |
| 9.0.25 | 180 | 1/2/2025 |
| 9.0.24 | 171 | 1/2/2025 |
| 9.0.23 | 168 | 1/2/2025 |
| 9.0.22 | 186 | 1/2/2025 |
| 9.0.21 | 172 | 1/2/2025 |
| 9.0.20 | 158 | 1/2/2025 |
| 9.0.19 | 193 | 1/2/2025 |
| 9.0.18 | 172 | 1/2/2025 |
| 9.0.17 | 188 | 12/27/2024 |
| 9.0.16 | 170 | 12/27/2024 |
| 9.0.15 | 172 | 12/27/2024 |
| 9.0.14 | 167 | 12/27/2024 |
| 9.0.13 | 153 | 12/27/2024 |
| 9.0.12 | 166 | 12/27/2024 |
| 9.0.9 | 184 | 12/26/2024 |
| 9.0.8 | 179 | 12/25/2024 |
| 9.0.7 | 155 | 12/25/2024 |
| 9.0.6 | 179 | 12/25/2024 |
| 9.0.5 | 173 | 12/25/2024 |
| 9.0.4 | 178 | 12/24/2024 |
| 1.0.3 | 176 | 12/24/2024 |
| 1.0.2 | 163 | 12/24/2024 |
| 1.0.1 | 174 | 12/24/2024 |
| 1.0.0 | 161 | 12/24/2024 |