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