{"action":"created","issue":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/966","labels_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/966/labels{/name}","comments_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/966/comments","events_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/966/events","html_url":"https://github.com/akkadotnet/akka.net/pull/966","id":75236502,"number":966,"title":"Added Extensions methods to ActorSystem and ActorContext to make DI more accessible","user":{"login":"thomaslazar","id":570244,"avatar_url":"https://avatars.githubusercontent.com/u/570244?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaslazar","html_url":"https://github.com/thomaslazar","followers_url":"https://api.github.com/users/thomaslazar/followers","following_url":"https://api.github.com/users/thomaslazar/following{/other_user}","gists_url":"https://api.github.com/users/thomaslazar/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaslazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaslazar/subscriptions","organizations_url":"https://api.github.com/users/thomaslazar/orgs","repos_url":"https://api.github.com/users/thomaslazar/repos","events_url":"https://api.github.com/users/thomaslazar/events{/privacy}","received_events_url":"https://api.github.com/users/thomaslazar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akkadotnet/akka.net/labels/on%20hold","name":"on hold","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2015-05-11T14:14:23Z","updated_at":"2015-05-19T14:35:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/akkadotnet/akka.net/pulls/966","html_url":"https://github.com/akkadotnet/akka.net/pull/966","diff_url":"https://github.com/akkadotnet/akka.net/pull/966.diff","patch_url":"https://github.com/akkadotnet/akka.net/pull/966.patch"},"body":"Issue #965\r\n\r\nAdded a new class `DIActorSystemAdapter.cs` containing methods to extend the `ActorSystem` with an `ActorOf` (return an `IActorRef` similar to the `DIActorContextApapter` method) and `Props` (returns a `Props` object that can be further configure) method that use DI to create the Actor dependencies. \r\n\r\nAdded a `Props` method to `DIActorContextAdapter.cs` similar to the `DIActorSystemAdapter` class one. \r\n\r\nAdded a `DI()` extension method for `ActorSystem` in `Extensions.cs` that uses the `DIActorSystemAdapter` class.  \r\n\r\nWith these changes it is now possible to create `Props` and `Actors` on the `ActorSystem` level without having to use a `IDependencyResolver` implementation available or through `system.GetExtensions<DIExt>().Props` call. \r\n\r\n    // get an Actor through DI directly from the ActorSystem\r\n    var worker = system.DI().ActorOf<TypedWorker>(\"worker\");\r\n    \r\n    // get Props through DI directly from the ActorSystem\r\n    var router = system.ActorOf(system.DI().Props<TypedWorker>().WithRouter(FromConfig.Instance), \"router\");\r\n    \r\nIt is also possible to now create `Props` from within an Actor through DI and configure it further.\r\n\r\n    // get Props from within an Actor using the DI extension\r\n    var router = Context.ActorOf(Context.DI().Props<TypedWorker>().WithRouter(FromConfig.Instance), \"router\");"},"comment":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/comments/103526390","html_url":"https://github.com/akkadotnet/akka.net/pull/966#issuecomment-103526390","issue_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/966","id":103526390,"user":{"login":"nvivo","id":202449,"avatar_url":"https://avatars.githubusercontent.com/u/202449?v=3","gravatar_id":"","url":"https://api.github.com/users/nvivo","html_url":"https://github.com/nvivo","followers_url":"https://api.github.com/users/nvivo/followers","following_url":"https://api.github.com/users/nvivo/following{/other_user}","gists_url":"https://api.github.com/users/nvivo/gists{/gist_id}","starred_url":"https://api.github.com/users/nvivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvivo/subscriptions","organizations_url":"https://api.github.com/users/nvivo/orgs","repos_url":"https://api.github.com/users/nvivo/repos","events_url":"https://api.github.com/users/nvivo/events{/privacy}","received_events_url":"https://api.github.com/users/nvivo/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T14:35:32Z","updated_at":"2015-05-19T14:35:32Z","body":"@thomaslazar +300 for DIActorSystemAdapter!"}}