{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Home/issues/1535","repository_url":"https://api.github.com/repos/aspnet/Home","labels_url":"https://api.github.com/repos/aspnet/Home/issues/1535/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Home/issues/1535/comments","events_url":"https://api.github.com/repos/aspnet/Home/issues/1535/events","html_url":"https://github.com/aspnet/Home/issues/1535","id":158231476,"number":1535,"title":"Service Locator Pattern / Dependency Injection","user":{"login":"SimonOrdo","id":15930167,"avatar_url":"https://avatars.githubusercontent.com/u/15930167?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonOrdo","html_url":"https://github.com/SimonOrdo","followers_url":"https://api.github.com/users/SimonOrdo/followers","following_url":"https://api.github.com/users/SimonOrdo/following{/other_user}","gists_url":"https://api.github.com/users/SimonOrdo/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonOrdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonOrdo/subscriptions","organizations_url":"https://api.github.com/users/SimonOrdo/orgs","repos_url":"https://api.github.com/users/SimonOrdo/repos","events_url":"https://api.github.com/users/SimonOrdo/events{/privacy}","received_events_url":"https://api.github.com/users/SimonOrdo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-02T20:25:09Z","updated_at":"2016-06-06T16:26:54Z","closed_at":null,"body":"I understand that DI is the way to go for most things, but I'm wondering if it's still possible to use the service locator (anti) pattern to resolve services?\r\n\r\nHow, for instance, would I resolve a DB context from an ad-hoc class without passing a reference from a DI enabled caller?"},"comment":{"url":"https://api.github.com/repos/aspnet/Home/issues/comments/224011316","html_url":"https://github.com/aspnet/Home/issues/1535#issuecomment-224011316","issue_url":"https://api.github.com/repos/aspnet/Home/issues/1535","id":224011316,"user":{"login":"SimonOrdo","id":15930167,"avatar_url":"https://avatars.githubusercontent.com/u/15930167?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonOrdo","html_url":"https://github.com/SimonOrdo","followers_url":"https://api.github.com/users/SimonOrdo/followers","following_url":"https://api.github.com/users/SimonOrdo/following{/other_user}","gists_url":"https://api.github.com/users/SimonOrdo/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonOrdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonOrdo/subscriptions","organizations_url":"https://api.github.com/users/SimonOrdo/orgs","repos_url":"https://api.github.com/users/SimonOrdo/repos","events_url":"https://api.github.com/users/SimonOrdo/events{/privacy}","received_events_url":"https://api.github.com/users/SimonOrdo/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T16:26:54Z","updated_at":"2016-06-06T16:26:54Z","body":"```\r\nclass MyPoco\r\n{\r\n       public void PerformDBOperation()\r\n       {\r\n            // Some DBContext code\r\n       }\r\n}\r\n```\r\nWould be instantiated with\r\n\r\n`var test = new MyPoco();`"}}
{"actor":{"display_login":"SimonOrdo"}}