Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created September 28, 2016 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/13070b79a1674007ae352bfc2c332ace to your computer and use it in GitHub Desktop.
Save justinyoo/13070b79a1674007ae352bfc2c332ace to your computer and use it in GitHub Desktop.
Deserialising .NET Core Configuration Settings
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