{"action":"created","issue":{"url":"https://api.github.com/repos/modesttree/Zenject/issues/462","repository_url":"https://api.github.com/repos/modesttree/Zenject","labels_url":"https://api.github.com/repos/modesttree/Zenject/issues/462/labels{/name}","comments_url":"https://api.github.com/repos/modesttree/Zenject/issues/462/comments","events_url":"https://api.github.com/repos/modesttree/Zenject/issues/462/events","html_url":"https://github.com/modesttree/Zenject/issues/462","id":321797344,"number":462,"title":"FromNewComponentOnNewPrefab and FromResolveGetter unexpected behaviour","user":{"login":"tertle","id":6189147,"avatar_url":"https://avatars3.githubusercontent.com/u/6189147?v=4","gravatar_id":"","url":"https://api.github.com/users/tertle","html_url":"https://github.com/tertle","followers_url":"https://api.github.com/users/tertle/followers","following_url":"https://api.github.com/users/tertle/following{/other_user}","gists_url":"https://api.github.com/users/tertle/gists{/gist_id}","starred_url":"https://api.github.com/users/tertle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tertle/subscriptions","organizations_url":"https://api.github.com/users/tertle/orgs","repos_url":"https://api.github.com/users/tertle/repos","events_url":"https://api.github.com/users/tertle/events{/privacy}","received_events_url":"https://api.github.com/users/tertle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-10T03:28:32Z","updated_at":"2018-05-10T04:54:55Z","closed_at":null,"author_association":"NONE","body":"I'm trying to combo FromNewComponentOnNewPrefab  and FromResolveGetter to do some auto binding but it's not working as I'd expect\r\n\r\n```\r\n            [SerializeField] private GameObject _prefab;\r\n            container.BindInterfacesAndSelfTo<Foo>().FromNewComponentOnNewPrefab(_prefab).AsSingle().NonLazy();\r\n\r\n            container.Bind<Transform>()\r\n                .FromResolveGetter<Foo>(p => p.transform)\r\n                .AsSingle();\r\n\r\n            container.Bind<Rigidbody>()\r\n                .FromResolveGetter<Foo>(p => p.GetComponentInChildren<Rigidbody>())\r\n                .AsSingle();\r\n\r\n            ... etc\r\n```\r\n\r\nExpected result:\r\n- Prefab instantiated\r\n- Transform and rigidbody bound\r\n- 1 copy of Foo added to instance\r\n\r\nActual Result:\r\n- Prefab instantiated\r\n- Transform and rigidbody bound as expected\r\n- 3 copies of Foo added to instance\r\n\r\nIs this a bug or intended behaviour? I'd have thought it should only be a single instance of Foo as it's declared AsSingle()\r\n\r\nAlternatively if I do\r\n\r\n```\r\n            var instance = container.InstantiatePrefab(_prefab);\r\n            container.BindInterfacesAndSelfTo<Foo>().FromNewComponentOn(instance).AsSingle();\r\n```\r\n\r\nIt works fine"},"comment":{"url":"https://api.github.com/repos/modesttree/Zenject/issues/comments/387951759","html_url":"https://github.com/modesttree/Zenject/issues/462#issuecomment-387951759","issue_url":"https://api.github.com/repos/modesttree/Zenject/issues/462","id":387951759,"user":{"login":"svermeulen","id":810762,"avatar_url":"https://avatars3.githubusercontent.com/u/810762?v=4","gravatar_id":"","url":"https://api.github.com/users/svermeulen","html_url":"https://github.com/svermeulen","followers_url":"https://api.github.com/users/svermeulen/followers","following_url":"https://api.github.com/users/svermeulen/following{/other_user}","gists_url":"https://api.github.com/users/svermeulen/gists{/gist_id}","starred_url":"https://api.github.com/users/svermeulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svermeulen/subscriptions","organizations_url":"https://api.github.com/users/svermeulen/orgs","repos_url":"https://api.github.com/users/svermeulen/repos","events_url":"https://api.github.com/users/svermeulen/events{/privacy}","received_events_url":"https://api.github.com/users/svermeulen/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T04:54:55Z","updated_at":"2018-05-10T04:54:55Z","author_association":"OWNER","body":"What version of zenject?  Can't reproduce this behaviour on the version I'm using.  Multiple copies of Foo should not be added"}}
{"actor":{"display_login":"svermeulen"}}