{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1748","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1748/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1748/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1748/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1748","id":184252451,"number":1748,"title":"Paramterized mappings not working using VB.NET and Profiles","user":{"login":"CalinLeafshade","id":3149669,"avatar_url":"https://avatars.githubusercontent.com/u/3149669?v=3","gravatar_id":"","url":"https://api.github.com/users/CalinLeafshade","html_url":"https://github.com/CalinLeafshade","followers_url":"https://api.github.com/users/CalinLeafshade/followers","following_url":"https://api.github.com/users/CalinLeafshade/following{/other_user}","gists_url":"https://api.github.com/users/CalinLeafshade/gists{/gist_id}","starred_url":"https://api.github.com/users/CalinLeafshade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CalinLeafshade/subscriptions","organizations_url":"https://api.github.com/users/CalinLeafshade/orgs","repos_url":"https://api.github.com/users/CalinLeafshade/repos","events_url":"https://api.github.com/users/CalinLeafshade/events{/privacy}","received_events_url":"https://api.github.com/users/CalinLeafshade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-10-20T14:53:51Z","updated_at":"2016-10-24T10:06:11Z","closed_at":null,"body":"I've defined the following Profile:\r\n\r\n```VB\r\nPublic Class LearningPlanViewModelProfile\r\n    Inherits Profile\r\n\r\n    Protected Overrides Sub Configure()\r\n\r\n\r\n        ' This will be parameterised in projections\r\n        Dim userID As Integer = 0\r\n\r\n        CreateMap(Of LearningPlan, LearningPlanViewModel)().\r\n            ForMember(Function(dest) dest.TAPs,\r\n                      Sub(opts) opts.MapFrom(Function(src) src.LearningPlanRules.\r\n                                                 Select(Function(y) y.ContentLabel).\r\n                                                    SelectMany(Function(y) y.ContentLabelTAPs).\r\n                                                    Where(Function(y) y.TAP IsNot Nothing).\r\n                                                    Select(Function(y) y.TAP).Distinct()))\r\n\r\n        CreateMap(Of TAP, LearningPlanTapViewModel)().\r\n            ForMember(Function(src) src.Completion,\r\n                      Sub(opts) opts.MapFrom(Function(src) src.UserTAPs.\r\n                                                 Where(Function(ut) ut.UserID = userID).\r\n                                                 Select(Function(ut) ut.PercentComplete).\r\n                                                 DefaultIfEmpty(0).\r\n                                                 FirstOrDefault()))\r\n\r\n    End Sub\r\n\r\nEnd Class\r\n```\r\n\r\nAnd I'm mapping like this:\r\n\r\n```VB\r\nDim plans = Await _lpQueryService.\r\n                    GetAllLearningPlansForUserQuery(Principal.UserID, Principal.CompanyScopeId).\r\n                    ProjectTo(Of LearningPlanViewModel)(_mapper.ConfigurationProvider, New Dictionary(Of String, Object) From {{\"userID\", Principal.UserID}}).ToArrayAsync()\r\n```\r\n\r\nThe map always returns the results as if the userID param were 0. If I change the default value of that parameter then it uses that value. It doesn't seem to be correctly injecting the new value.\r\n"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/255700062","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1748#issuecomment-255700062","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1748","id":255700062,"user":{"login":"CalinLeafshade","id":3149669,"avatar_url":"https://avatars.githubusercontent.com/u/3149669?v=3","gravatar_id":"","url":"https://api.github.com/users/CalinLeafshade","html_url":"https://github.com/CalinLeafshade","followers_url":"https://api.github.com/users/CalinLeafshade/followers","following_url":"https://api.github.com/users/CalinLeafshade/following{/other_user}","gists_url":"https://api.github.com/users/CalinLeafshade/gists{/gist_id}","starred_url":"https://api.github.com/users/CalinLeafshade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CalinLeafshade/subscriptions","organizations_url":"https://api.github.com/users/CalinLeafshade/orgs","repos_url":"https://api.github.com/users/CalinLeafshade/repos","events_url":"https://api.github.com/users/CalinLeafshade/events{/privacy}","received_events_url":"https://api.github.com/users/CalinLeafshade/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T10:06:11Z","updated_at":"2016-10-24T10:06:11Z","body":"Yep, that seems to work as expected. Good work guys. This can be closed from my perspective once the PR is merged in."}}
{"actor":{"display_login":"CalinLeafshade"}}