-
-
Save justinyoo/13070b79a1674007ae352bfc2c332ace to your computer and use it in GitHub Desktop.
Deserialising .NET Core Configuration Settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T Get<T>(this IConfiguration config, string key) where T : new() | |
{ | |
var instance = new T(); | |
config.GetSection(key).Bind(instance); | |
return instance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment