{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2347","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2347/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2347/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2347/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2347","id":261970620,"number":2347,"title":"Upgrading from 2.1.267 to 6.1.1 KeyValuePair to DTO error","user":{"login":"cblaze22","id":556494,"avatar_url":"https://avatars0.githubusercontent.com/u/556494?v=4","gravatar_id":"","url":"https://api.github.com/users/cblaze22","html_url":"https://github.com/cblaze22","followers_url":"https://api.github.com/users/cblaze22/followers","following_url":"https://api.github.com/users/cblaze22/following{/other_user}","gists_url":"https://api.github.com/users/cblaze22/gists{/gist_id}","starred_url":"https://api.github.com/users/cblaze22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cblaze22/subscriptions","organizations_url":"https://api.github.com/users/cblaze22/orgs","repos_url":"https://api.github.com/users/cblaze22/repos","events_url":"https://api.github.com/users/cblaze22/events{/privacy}","received_events_url":"https://api.github.com/users/cblaze22/received_events","type":"User","site_admin":false},"labels":[{"id":92629237,"url":"https://api.github.com/repos/AutoMapper/AutoMapper/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-10-02T02:45:06Z","updated_at":"2017-10-02T18:06:29Z","closed_at":null,"author_association":"NONE","body":"For some reason the code below wont work while upgrading from 2.1.267 to 6.1.1.  I get this error below?\r\n\r\n```\r\n\r\n            Mapper.Initialize(cfg =>\r\n            {\r\n              \r\n                cfg.CreateMap<KeyValuePair<string, object>, MetaModel>()\r\n                    .ForMember(dest => dest.Id, opt => opt.Ignore())\r\n                    .ForMember(dest => dest.Type, opt => opt.Ignore())\r\n                    .ForMember(dest => dest.Required, opt => opt.Ignore())\r\n                    .ForMember(dest => dest.Hidden, opt => opt.Ignore())\r\n                    .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Key))\r\n                    .ForMember(dest => dest.Value, opt => opt.MapFrom(src => src.Value));\r\n```\r\n\r\n```\r\nExpression of type 'System.Collections.Generic.KeyValuePair`2[System.String,System.Object]' cannot be used for parameter of type 'System.Object' of method 'Void CacheDestination(System.Object, System.Type, System.Object)'\r\n\r\n[ArgumentException: Expression of type 'System.Collections.Generic.KeyValuePair`2[System.String,System.Object]' cannot be used for parameter of type 'System.Object' of method 'Void CacheDestination(System.Object, System.Type, System.Object)']\r\n   System.Linq.Expressions.Expression.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arg, ParameterInfo pi) +314\r\n   System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, Expression arg0, Expression arg1, Expression arg2) +102\r\n   AutoMapper.Execution.TypeMapPlanBuilder.CreateDestinationFunc(Boolean& constructorMapping) +229\r\n   AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda(HashSet`1 visitedTypeMaps) +315\r\n   AutoMapper.TypeMap.Seal(IConfigurationProvider configurationProvider, HashSet`1 visitedTypeMaps) +366\r\n   AutoMapper.MapperConfiguration.Seal() +1569\r\n   AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression) +743\r\n   AutoMapper.Mapper.Initialize(Action`1 config) +36\r\n   Tournaments.Models.RegisterMaps.Register() in C:\\Development\\Exposure\\AAUIntegration\\Projects\\Tournaments.Models\\RegisterMaps.cs:89\r\n   Tournaments.MvcApplication.OnApplicationStarted() in C:\\Development\\Exposure\\AAUIntegration\\Websites\\Tournaments\\Global.asax.cs:1032\r\n   Ninject.Web.Common.NinjectHttpApplication.Application_Start() +183\r\n\r\n[HttpException (0x80004005): Expression of type 'System.Collections.Generic.KeyValuePair`2[System.String,System.Object]' cannot be used for parameter of type 'System.Object' of method 'Void CacheDestination(System.Object, System.Type, System.Object)']\r\n   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +475\r\n   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118\r\n   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176\r\n   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +349\r\n   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +303\r\n\r\n[HttpException (0x80004005): Expression of type 'System.Collections.Generic.KeyValuePair`2[System.String,System.Object]' cannot be used for parameter of type 'System.Object' of method 'Void CacheDestination(System.Object, System.Type, System.Object)']\r\n   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +658\r\n   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +89\r\n   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +188\r\n```"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/333616378","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2347#issuecomment-333616378","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2347","id":333616378,"user":{"login":"lbargaoanu","id":4517428,"avatar_url":"https://avatars2.githubusercontent.com/u/4517428?v=4","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-10-02T18:06:29Z","updated_at":"2017-10-02T18:06:29Z","author_association":"MEMBER","body":"https://github.com/AutoMapper/AutoMapper/issues/2346#issuecomment-333533955"}}
{"actor":{"display_login":"lbargaoanu"}}