{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Configuration/issues/379","repository_url":"https://api.github.com/repos/aspnet/Configuration","labels_url":"https://api.github.com/repos/aspnet/Configuration/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Configuration/issues/379/comments","events_url":"https://api.github.com/repos/aspnet/Configuration/issues/379/events","html_url":"https://github.com/aspnet/Configuration/issues/379","id":132330186,"number":379,"title":"Use reflection to examine an object for configuration properties","user":{"login":"nbarbettini","id":7525482,"avatar_url":"https://avatars.githubusercontent.com/u/7525482?v=3","gravatar_id":"","url":"https://api.github.com/users/nbarbettini","html_url":"https://github.com/nbarbettini","followers_url":"https://api.github.com/users/nbarbettini/followers","following_url":"https://api.github.com/users/nbarbettini/following{/other_user}","gists_url":"https://api.github.com/users/nbarbettini/gists{/gist_id}","starred_url":"https://api.github.com/users/nbarbettini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbarbettini/subscriptions","organizations_url":"https://api.github.com/users/nbarbettini/orgs","repos_url":"https://api.github.com/users/nbarbettini/repos","events_url":"https://api.github.com/users/nbarbettini/events{/privacy}","received_events_url":"https://api.github.com/users/nbarbettini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-09T04:39:26Z","updated_at":"2016-02-09T04:41:14Z","closed_at":null,"body":"For one of my use cases, I want the user to be able to provide an instance of a POCO containing configuration properties and values.\r\n\r\nFor example,\r\n```csharp\r\nclass MyConfiguration\r\n{\r\n    public string Foo { get; set; }\r\n    public NestedConfiguration Bar { get; set; }\r\n}\r\n\r\nclass NestedConfiguration\r\n{\r\n    public int Baz { get; set; }\r\n}\r\n\r\n[...]\r\n\r\nvar customConfig = new MyConfiguration()\r\n{\r\n    Foo = \"hello!\",\r\n    Bar = new NestedConfiguration()\r\n    {\r\n        Baz = 123\r\n    }\r\n};\r\nbuilder.AddObject(customConfig);\r\n```\r\nwould produce the keys\r\n```\r\n[\"foo\"] = \"hello!\"\r\n[\"bar.baz\"] = \"123\"\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/Configuration/issues/comments/181708920","html_url":"https://github.com/aspnet/Configuration/issues/379#issuecomment-181708920","issue_url":"https://api.github.com/repos/aspnet/Configuration/issues/379","id":181708920,"user":{"login":"nbarbettini","id":7525482,"avatar_url":"https://avatars.githubusercontent.com/u/7525482?v=3","gravatar_id":"","url":"https://api.github.com/users/nbarbettini","html_url":"https://github.com/nbarbettini","followers_url":"https://api.github.com/users/nbarbettini/followers","following_url":"https://api.github.com/users/nbarbettini/following{/other_user}","gists_url":"https://api.github.com/users/nbarbettini/gists{/gist_id}","starred_url":"https://api.github.com/users/nbarbettini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbarbettini/subscriptions","organizations_url":"https://api.github.com/users/nbarbettini/orgs","repos_url":"https://api.github.com/users/nbarbettini/repos","events_url":"https://api.github.com/users/nbarbettini/events{/privacy}","received_events_url":"https://api.github.com/users/nbarbettini/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T04:41:14Z","updated_at":"2016-02-09T04:41:14Z","body":"I wrote a `ConfigurationProvider` for my project to satisfy this requirement. I added support for anonymous types as well.\r\n\r\nThe code is here: https://github.com/stormpath/stormpath-dotnet-config/tree/master/Microsoft.Extensions.Configuration.Contrib.Stormpath.ObjectReflection\r\n\r\nI'm happy to copy my code into a PR for this repo, if this is something that's on the roadmap. :smile: "}}