feat: IConfiguration for system and other configurations

This commit is contained in:
2026-02-09 13:15:13 +03:00
parent 32a7e9be24
commit 3b1c291588
4 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
using Engine.Core.Exceptions;
namespace Engine.Core.Config;
public static class ConfigurationExtensions
{
public static T GetRequired<T>(this IConfiguration configuration, string key) => configuration.Get<T>(key) ?? throw new NotFoundException($"Type of {typeof(T).FullName} with the key {key} was not present in the {configuration.GetType().FullName}");
}