{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/843","repository_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet","labels_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/843/labels{/name}","comments_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/843/comments","events_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/843/events","html_url":"https://github.com/graphql-dotnet/graphql-dotnet/issues/843","id":366156354,"node_id":"MDU6SXNzdWUzNjYxNTYzNTQ=","number":843,"title":"Dependency injection example using unity container in .net framework 4","user":{"login":"clustersnake","id":16407149,"node_id":"MDQ6VXNlcjE2NDA3MTQ5","avatar_url":"https://avatars0.githubusercontent.com/u/16407149?v=4","gravatar_id":"","url":"https://api.github.com/users/clustersnake","html_url":"https://github.com/clustersnake","followers_url":"https://api.github.com/users/clustersnake/followers","following_url":"https://api.github.com/users/clustersnake/following{/other_user}","gists_url":"https://api.github.com/users/clustersnake/gists{/gist_id}","starred_url":"https://api.github.com/users/clustersnake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clustersnake/subscriptions","organizations_url":"https://api.github.com/users/clustersnake/orgs","repos_url":"https://api.github.com/users/clustersnake/repos","events_url":"https://api.github.com/users/clustersnake/events{/privacy}","received_events_url":"https://api.github.com/users/clustersnake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-03T03:00:05Z","updated_at":"2018-10-19T15:51:06Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  To make it easier for us to help you, please include as much useful information as possible.\r\n\r\n  Useful Links:\r\n  - Documentation: https://graphql-dotnet.github.io/\r\n\r\n  GraphQL .NET has community support channels, try asking your question on:\r\n\r\n  - Gitter: https://gitter.im/graphql-dotnet/graphql-dotnet\r\n  - Stack Overflow: https://stackoverflow.com/questions/tagged/graphql-dotnet\r\n\r\n  Before opening a new issue, please search existing issues https://github.com/graphql-dotnet/graphql-dotnet/issues\r\n-->\r\n\r\n## Summary\r\nI'm currently using .net framework and I can't find a working example of dependency injection with unity container, in fact all I've found are .net core examples but I'm stuck with the old platform.\r\nCould you please give some indications about the correct use of dependency injection in GraphQL types? I had to instantiate my repositories inside my types to make the queries and It just doesn't feel right.\r\n## Relevant information\r\nI'm using unity container for my repositories dependency injection in the web controller\r\nhttps://github.com/unitycontainer/unity\r\n\r\nand I'm configuring it in WebApiConfig.cs\r\n\r\n```\r\n    public static class WebApiConfig\r\n    {\r\n        public static void Register(HttpConfiguration config)\r\n        {\r\n            // Web API configuration and services\r\n            var container = new UnityContainer();\r\n            container.RegisterType<IUsuarioRepository, UsuarioRepository>(new HierarchicalLifetimeManager());\r\n            container.RegisterType<IGrupoRepository, GrupoRepository>(new HierarchicalLifetimeManager());\r\n            container.RegisterType<ITareaRepository, TareaRepository>(new HierarchicalLifetimeManager());\r\n\r\n            config.DependencyResolver = new UnityResolver(container);\r\n\r\n\r\n```\r\nI really don't know if it's possible to inject the repositories in my types constructors to be able to make the queries using them\r\n<!-- Provide as much useful information as you can -->\r\n\r\n### Environment (if relevant)\r\n.net framework 4.6.1\r\nwebApi 5.2\r\n<!--\r\n  Version, OS, Server Architecture, etc.\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/comments/431409735","html_url":"https://github.com/graphql-dotnet/graphql-dotnet/issues/843#issuecomment-431409735","issue_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/843","id":431409735,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTQwOTczNQ==","user":{"login":"clustersnake","id":16407149,"node_id":"MDQ6VXNlcjE2NDA3MTQ5","avatar_url":"https://avatars0.githubusercontent.com/u/16407149?v=4","gravatar_id":"","url":"https://api.github.com/users/clustersnake","html_url":"https://github.com/clustersnake","followers_url":"https://api.github.com/users/clustersnake/followers","following_url":"https://api.github.com/users/clustersnake/following{/other_user}","gists_url":"https://api.github.com/users/clustersnake/gists{/gist_id}","starred_url":"https://api.github.com/users/clustersnake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clustersnake/subscriptions","organizations_url":"https://api.github.com/users/clustersnake/orgs","repos_url":"https://api.github.com/users/clustersnake/repos","events_url":"https://api.github.com/users/clustersnake/events{/privacy}","received_events_url":"https://api.github.com/users/clustersnake/received_events","type":"User","site_admin":false},"created_at":"2018-10-19T15:51:06Z","updated_at":"2018-10-19T15:51:06Z","author_association":"NONE","body":"@joro550 maybe I'm just too noob to this. I have to really learn this\r\n![image](https://user-images.githubusercontent.com/16407149/47228712-e1fe6900-d393-11e8-8351-a6ba43ac9a5b.png)\r\n"}}
{"actor":{"display_login":"clustersnake"}}