mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-13 12:24:35 +01:00
Add project files.
This commit is contained in:
13
Common/Common.csproj
Normal file
13
Common/Common.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Config.Net" Version="5.1.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
25
Common/Program.cs
Normal file
25
Common/Program.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Config.Net;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
public static class Global
|
||||
{
|
||||
public static IConfig config = new ConfigurationBuilder<IConfig>().UseJsonFile("config.json").Build();
|
||||
}
|
||||
|
||||
public interface IConfig
|
||||
{
|
||||
[Option(DefaultValue = VerboseLevel.Normal)]
|
||||
VerboseLevel VerboseLevel { get; }
|
||||
|
||||
[Option(DefaultValue = "mongodb://localhost:27017/crepebh")]
|
||||
string DatabaseUri { get; }
|
||||
|
||||
}
|
||||
|
||||
public enum VerboseLevel
|
||||
{
|
||||
Normal = 0,
|
||||
Debug = 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user