DEV Community


Discussion on: Learn how YOU can manage your app configuration in ASP .NET Core

softchris profile image
Chris Noring Author

hey.. Are you saying GetSection() and use bind() to a type isn't enough? One nice solution (that some libs use) is extension methods like so:

public static string GetMyProperty(this IConfiguration configuration)
        string result = configuration.GetValue<string>("My:Key");
        return result;

// usage
Enter fullscreen mode Exit fullscreen mode