{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2021","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2021/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2021/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2021/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2021","id":216022740,"number":2021,"title":"Construct the value resolver with the supplied constructor function not working with latest version","user":{"login":"AnshulMehta187","id":26597022,"avatar_url":"https://avatars2.githubusercontent.com/u/26597022?v=3","gravatar_id":"","url":"https://api.github.com/users/AnshulMehta187","html_url":"https://github.com/AnshulMehta187","followers_url":"https://api.github.com/users/AnshulMehta187/followers","following_url":"https://api.github.com/users/AnshulMehta187/following{/other_user}","gists_url":"https://api.github.com/users/AnshulMehta187/gists{/gist_id}","starred_url":"https://api.github.com/users/AnshulMehta187/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnshulMehta187/subscriptions","organizations_url":"https://api.github.com/users/AnshulMehta187/orgs","repos_url":"https://api.github.com/users/AnshulMehta187/repos","events_url":"https://api.github.com/users/AnshulMehta187/events{/privacy}","received_events_url":"https://api.github.com/users/AnshulMehta187/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-22T10:56:16Z","updated_at":"2017-03-22T11:52:52Z","closed_at":null,"body":"Hi guys\r\n\r\nI am working on VS 2013 and was currently using AutoMapper version 3.2.1 ,I have upgraded to the latest version 6.0.1 and updating my code base as per new features available with the latest version.\r\n\r\nI am using CustomValue Resolver named BaseSectionNameResolver to resolve value for destination member name ,please see code below\r\nconfig.CreateMap<TemplateTabRootTemplateTabSection, DTO.TabRender.Section>()\r\n  .ForMember(dest1 => dest1.Name, opt => opt.ResolveUsing<BaseSectionNameResolver>().ConstructedBy(() => new BaseSectionNameResolver(translationCoordinator, cache, rc, request)))\r\n\r\n\r\nNow as per the latest version ,I am not able to access the ConstructedBy method here to supply a constructor function .Is it possible for me to pass something like below to resolve this\r\nMapper.Initialize(cfg =>\r\n            {\r\n                cfg.CreateMap<TemplateTabRootTemplateTabSection, DTO.TabRender.Section>() \r\n                .ForMember(dest1 => dest1.Name, opt => opt.ResolveUsing<BaseSectionNameResolver>()).ConstructedBy(() => new BaseSectionNameResolver(translationCoordinator, cache, rc, request)))});\r\n            });\r\n\r\nI found one method called ConstructUsing but it is used to provide custom instantiation for the destination type and not for the Custom Value Resolver .\r\nPlease suggest ."},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/288376123","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2021#issuecomment-288376123","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2021","id":288376123,"user":{"login":"lbargaoanu","id":4517428,"avatar_url":"https://avatars1.githubusercontent.com/u/4517428?v=3","gravatar_id":"","url":"https://api.github.com/users/lbargaoanu","html_url":"https://github.com/lbargaoanu","followers_url":"https://api.github.com/users/lbargaoanu/followers","following_url":"https://api.github.com/users/lbargaoanu/following{/other_user}","gists_url":"https://api.github.com/users/lbargaoanu/gists{/gist_id}","starred_url":"https://api.github.com/users/lbargaoanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbargaoanu/subscriptions","organizations_url":"https://api.github.com/users/lbargaoanu/orgs","repos_url":"https://api.github.com/users/lbargaoanu/repos","events_url":"https://api.github.com/users/lbargaoanu/events{/privacy}","received_events_url":"https://api.github.com/users/lbargaoanu/received_events","type":"User","site_admin":false},"created_at":"2017-03-22T11:52:52Z","updated_at":"2017-03-22T11:52:52Z","body":"I'm guessing the resolver cannot be a singleton. Then you can use the Mapper constructor that takes a service constructor. You can use your container to create the resolver or you cand do it by hand."}}
{"actor":{"display_login":"lbargaoanu"}}