{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1109","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1109/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1109/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1109/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1109","id":133549755,"number":1109,"title":"AutoMapperRegistry : Registry with Autofac","user":{"login":"TDK1964","id":1914368,"avatar_url":"https://avatars.githubusercontent.com/u/1914368?v=3","gravatar_id":"","url":"https://api.github.com/users/TDK1964","html_url":"https://github.com/TDK1964","followers_url":"https://api.github.com/users/TDK1964/followers","following_url":"https://api.github.com/users/TDK1964/following{/other_user}","gists_url":"https://api.github.com/users/TDK1964/gists{/gist_id}","starred_url":"https://api.github.com/users/TDK1964/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TDK1964/subscriptions","organizations_url":"https://api.github.com/users/TDK1964/orgs","repos_url":"https://api.github.com/users/TDK1964/repos","events_url":"https://api.github.com/users/TDK1964/events{/privacy}","received_events_url":"https://api.github.com/users/TDK1964/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-14T16:03:49Z","updated_at":"2016-02-17T14:47:53Z","closed_at":null,"body":"Could anyone help make the following example work with Autofac?\r\n\r\n```\r\npublic class AutoMapperRegistry : Registry\r\n{\r\n    public AutoMapperRegistry()\r\n    {\r\n        var profiles =\r\n            from t in typeof (AutoMapperRegistry).Assembly.GetTypes()\r\n            where typeof (Profile).IsAssignableFrom(t)\r\n            select (Profile)Activator.CreateInstance(t);\r\n\r\n        var config = new MapperConfiguration(cfg =>\r\n        {\r\n            foreach (var profile in profiles)\r\n            {\r\n                cfg.AddProfile(profile);\r\n            }\r\n        });\r\n\r\n        For<MapperConfiguration>().Use(config);\r\n        For<IMapper>().Use(ctx => ctx.GetInstance<MapperConfiguration>().CreateMapper(ctx.GetInstance));\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/185236042","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1109#issuecomment-185236042","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1109","id":185236042,"user":{"login":"TDK1964","id":1914368,"avatar_url":"https://avatars.githubusercontent.com/u/1914368?v=3","gravatar_id":"","url":"https://api.github.com/users/TDK1964","html_url":"https://github.com/TDK1964","followers_url":"https://api.github.com/users/TDK1964/followers","following_url":"https://api.github.com/users/TDK1964/following{/other_user}","gists_url":"https://api.github.com/users/TDK1964/gists{/gist_id}","starred_url":"https://api.github.com/users/TDK1964/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TDK1964/subscriptions","organizations_url":"https://api.github.com/users/TDK1964/orgs","repos_url":"https://api.github.com/users/TDK1964/repos","events_url":"https://api.github.com/users/TDK1964/events{/privacy}","received_events_url":"https://api.github.com/users/TDK1964/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T14:47:53Z","updated_at":"2016-02-17T14:47:53Z","body":"@mpetito thanks for the update but my experience of AM and AF are very very limited so I really have no idea how to implement your suggestions :("}}