9 lines
363 B
C#
9 lines
363 B
C#
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}");
|
|
}
|