{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1350","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1350/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1350/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1350/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1350","id":161163319,"number":1350,"title":"'needs to have a constructor with 0 args or only optional args' In Version 5 beta","user":{"login":"hrfarrokh","id":20038059,"avatar_url":"https://avatars.githubusercontent.com/u/20038059?v=3","gravatar_id":"","url":"https://api.github.com/users/hrfarrokh","html_url":"https://github.com/hrfarrokh","followers_url":"https://api.github.com/users/hrfarrokh/followers","following_url":"https://api.github.com/users/hrfarrokh/following{/other_user}","gists_url":"https://api.github.com/users/hrfarrokh/gists{/gist_id}","starred_url":"https://api.github.com/users/hrfarrokh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrfarrokh/subscriptions","organizations_url":"https://api.github.com/users/hrfarrokh/orgs","repos_url":"https://api.github.com/users/hrfarrokh/repos","events_url":"https://api.github.com/users/hrfarrokh/events{/privacy}","received_events_url":"https://api.github.com/users/hrfarrokh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-20T10:23:01Z","updated_at":"2016-06-20T15:29:02Z","closed_at":null,"body":"Hi\r\nThis code works properly in version 4.2.1\r\nBUT\r\nWhenever i update to version 5 beta\r\nit throws an exception and complains about a parameter-less ctor for CollectionController<,,>\r\n\r\n```\r\n    public class OrganizationDTO\r\n    {\r\n        public long? ID { get; set; }\r\n        public string Name { get; set; }\r\n\r\n        private CollectionDTOController<BranchDTO, short> _branchCollection;\r\n        public CollectionDTOController<BranchDTO, short> BranchCollection\r\n        {\r\n            get\r\n            {\r\n                if (_branchCollection == null)\r\n                    _branchCollection = new CollectionDTOController<BranchDTO, short>();\r\n\r\n                return _branchCollection;\r\n            }\r\n            set { _branchCollection = value; }\r\n        }\r\n    }\r\n\r\n    public class BranchDTO\r\n    {\r\n        public short? ID { get; set; }\r\n        public string Name { get; set; }\r\n\r\n    }\r\n\r\n    public class CollectionDTOController<T, K>\r\n       where T : class\r\n       where K : struct\r\n    {\r\n        public IEnumerable<T> Models { get; set; }\r\n        public K? SelectedID { get; set; }\r\n    }\r\n\r\n    public class Organization\r\n    {\r\n        public long? ID { get; set; }\r\n        public string Name { get; set; }\r\n\r\n        private CollectionController<Branch, short, EventArgs> _BranchCollection;\r\n        public CollectionController<Branch, short, EventArgs> BranchCollection\r\n        {\r\n            get\r\n            {\r\n                if (_BranchCollection == null)\r\n                    _BranchCollection = new CollectionController<Branch, short, EventArgs>(this);\r\n\r\n                return _BranchCollection;\r\n            }\r\n            set { _BranchCollection = value; }\r\n        }\r\n    }\r\n\r\n    public class Branch\r\n    {\r\n        public short? ID { get; set; }\r\n        public string Name { get; set; }\r\n\r\n    }\r\n\r\n    public class CollectionController<T, K, Z>\r\n        where T : class\r\n        where K : struct\r\n        where Z : EventArgs\r\n    {\r\n        private object _owner;\r\n        public CollectionController(object owner)\r\n        {\r\n            _owner = owner;\r\n        }\r\n        public IEnumerable<T> Models { get; set; }\r\n        public K? SelectedID { get; set; }\r\n        public event EventHandler<Z> SelectionChanged;\r\n    }\r\n\r\n        static void Main(string[] args)\r\n        {\r\n            Mapper.Initialize(cfg =>\r\n            {\r\n                cfg.CreateMap<OrganizationDTO, Organization>();\r\n                cfg.CreateMap<BranchDTO, Branch>();\r\n                cfg.CreateMap(typeof(CollectionDTOController<,>), typeof(CollectionController<,,>));\r\n\r\n\r\n            });\r\n\r\n            var branchDto = new BranchDTO { ID = 51, Name = \"B1\" };\r\n            var orgDto = new OrganizationDTO { ID = 5, Name = \"O1\" };\r\n            orgDto.BranchCollection.Models = new BranchDTO[] { branchDto };\r\n\r\n            var obj = Mapper.Map<Organization>(orgDto);\r\n\r\n            Console.ReadLine();\r\n        }\r\n\r\n```\r\n\r\nCollectionController`3[Branch, Int16, EventArgs] needs to have a constructor with 0 args or only optional args Parameter name: type"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/227176927","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1350#issuecomment-227176927","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1350","id":227176927,"user":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T15:29:02Z","updated_at":"2016-06-20T15:29:02Z","body":"Can you try the MyGet?"}}
{"actor":{"display_login":"jbogard"}}