{"action":"created","issue":{"url":"https://api.github.com/repos/bilal-fazlani/commanddotnet/issues/42","repository_url":"https://api.github.com/repos/bilal-fazlani/commanddotnet","labels_url":"https://api.github.com/repos/bilal-fazlani/commanddotnet/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/bilal-fazlani/commanddotnet/issues/42/comments","events_url":"https://api.github.com/repos/bilal-fazlani/commanddotnet/issues/42/events","html_url":"https://github.com/bilal-fazlani/commanddotnet/issues/42","id":293389961,"number":42,"title":"Call commands from other commands","user":{"login":"dotnetshadow","id":296247,"avatar_url":"https://avatars1.githubusercontent.com/u/296247?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnetshadow","html_url":"https://github.com/dotnetshadow","followers_url":"https://api.github.com/users/dotnetshadow/followers","following_url":"https://api.github.com/users/dotnetshadow/following{/other_user}","gists_url":"https://api.github.com/users/dotnetshadow/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnetshadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnetshadow/subscriptions","organizations_url":"https://api.github.com/users/dotnetshadow/orgs","repos_url":"https://api.github.com/users/dotnetshadow/repos","events_url":"https://api.github.com/users/dotnetshadow/events{/privacy}","received_events_url":"https://api.github.com/users/dotnetshadow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-01T03:17:02Z","updated_at":"2018-02-01T03:22:56Z","closed_at":null,"author_association":"NONE","body":"Great effort with this library, I like the new features you have been implementing\r\n\r\nI was wondering how you would go about handling or structuring the following requirement\r\n\r\nSay I have 3 commands\r\n**Command1**, **Command2** and **All**\r\n\r\nFor my All Command I would like to call **Command1** and **Command2**\r\nCurrently I'm able to do this by doing the following:\r\n\r\n```\r\n[DefaultMethod]\r\npublic void AllCommand() {\r\n   var command1 = new Command1();\r\n   command1.DoSomethng();\r\n}\r\n```\r\n\r\nWhile this works, the issue is if **Command1** has dependencies IFooService this wouldn't be injected because I'm newing up commmands. \r\n\r\nI'm just wondering how you would about structuring such a requirement?\r\n\r\nThanks for your time and effort"},"comment":{"url":"https://api.github.com/repos/bilal-fazlani/commanddotnet/issues/comments/362146696","html_url":"https://github.com/bilal-fazlani/commanddotnet/issues/42#issuecomment-362146696","issue_url":"https://api.github.com/repos/bilal-fazlani/commanddotnet/issues/42","id":362146696,"user":{"login":"dotnetshadow","id":296247,"avatar_url":"https://avatars1.githubusercontent.com/u/296247?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnetshadow","html_url":"https://github.com/dotnetshadow","followers_url":"https://api.github.com/users/dotnetshadow/followers","following_url":"https://api.github.com/users/dotnetshadow/following{/other_user}","gists_url":"https://api.github.com/users/dotnetshadow/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnetshadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnetshadow/subscriptions","organizations_url":"https://api.github.com/users/dotnetshadow/orgs","repos_url":"https://api.github.com/users/dotnetshadow/repos","events_url":"https://api.github.com/users/dotnetshadow/events{/privacy}","received_events_url":"https://api.github.com/users/dotnetshadow/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T03:22:56Z","updated_at":"2018-02-01T03:22:56Z","author_association":"NONE","body":"I realised that when I do new Command1() I can set the properties for my injected services\r\n\r\n```\r\n[InjectProperty]\r\npublic IFooService FooService { get; set; }\r\n\r\nvar command1 = new Command1 {\r\n     FooService  = FooService \r\n}\r\n```\r\n\r\nThe AllCommand would then need every service that would be required by whatever commands it needs to use. I'm thinking there must be a cleaner way for this?"}}
{"actor":{"display_login":"dotnetshadow"}}