{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/649","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/649/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/649/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/649/events","html_url":"https://github.com/AutoMapper/AutoMapper/pull/649","id":51944672,"number":649,"title":"Fix ExpressionMapper error for sub property expression conversion","user":{"login":"TylerCarlson1","id":6801536,"avatar_url":"https://avatars.githubusercontent.com/u/6801536?v=3","gravatar_id":"","url":"https://api.github.com/users/TylerCarlson1","html_url":"https://github.com/TylerCarlson1","followers_url":"https://api.github.com/users/TylerCarlson1/followers","following_url":"https://api.github.com/users/TylerCarlson1/following{/other_user}","gists_url":"https://api.github.com/users/TylerCarlson1/gists{/gist_id}","starred_url":"https://api.github.com/users/TylerCarlson1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TylerCarlson1/subscriptions","organizations_url":"https://api.github.com/users/TylerCarlson1/orgs","repos_url":"https://api.github.com/users/TylerCarlson1/repos","events_url":"https://api.github.com/users/TylerCarlson1/events{/privacy}","received_events_url":"https://api.github.com/users/TylerCarlson1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2014-12-15T03:12:31Z","updated_at":"2015-07-12T04:31:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/pulls/649","html_url":"https://github.com/AutoMapper/AutoMapper/pull/649","diff_url":"https://github.com/AutoMapper/AutoMapper/pull/649.diff","patch_url":"https://github.com/AutoMapper/AutoMapper/pull/649.patch"},"body":"Fix Issues with Expression Mappings #648 when use properties which types have their own mappings that need to be converted over.\r\n\r\nMultiple scenarios have been solved for now including the original problem.\r\nIssue still lies with multiple level same type one to many relationships. (One to many relationships of different types work fine)\r\nEx: ```Tools.Any(t => t.SubTools.Any(t => t.ID == id))``` will fail to convert over cause Any function will still be assuming ToolDTO instead of Tool as generic parameter type."},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/120685846","html_url":"https://github.com/AutoMapper/AutoMapper/pull/649#issuecomment-120685846","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/649","id":120685846,"user":{"login":"TylerCarlson1","id":6801536,"avatar_url":"https://avatars.githubusercontent.com/u/6801536?v=3","gravatar_id":"","url":"https://api.github.com/users/TylerCarlson1","html_url":"https://github.com/TylerCarlson1","followers_url":"https://api.github.com/users/TylerCarlson1/followers","following_url":"https://api.github.com/users/TylerCarlson1/following{/other_user}","gists_url":"https://api.github.com/users/TylerCarlson1/gists{/gist_id}","starred_url":"https://api.github.com/users/TylerCarlson1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TylerCarlson1/subscriptions","organizations_url":"https://api.github.com/users/TylerCarlson1/orgs","repos_url":"https://api.github.com/users/TylerCarlson1/repos","events_url":"https://api.github.com/users/TylerCarlson1/events{/privacy}","received_events_url":"https://api.github.com/users/TylerCarlson1/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T04:31:12Z","updated_at":"2015-07-12T04:31:12Z","body":"For Scenarios #704 that don't work I have a few.\r\nI'll be honest I looked at your code and compared to see if it had equivalent functionality to mine.\r\n\r\nDoesn't handle Nullable<TStruct> to TStruct or vice versa. Throws exception, but mine handles the conversion using UnaryExpression.\r\nLambda expressions only support lambdas with 1 parameter.  Ex: ```Where((entity, index) => index > 4)```\r\nLambda expressions that use parameters from parent lambdas.  Ex: ```p => p.Children.Where(c => c.Date < p.Date)```\r\nNote:  I'm not entirely sure about this one.\r\nYou account for properties, but I don't see anywhere you account for fields.\r\nNote: You SHOULDN'T be using fields, but field are supported, so they should be supported here.\r\nWCF OData support. (Has to do with use case for @Venzhyk in using UseAsDataSource())\r\n\r\nScenarios I don't have\r\nQuote conversion.  I've never seen or run into this before, and I have no clue if my logic works around it or not.  Would be great if you can provide me with an example of an expression that uses this expression type.\r\n\r\nOther things of note:\r\nImplementations are different in a few ways.\r\n1) You use sub ExpressionVisitor classes for things like lambdas, where mine has everything in one visitor, aside from parameter re-placer.\r\n2) Seems you have access to all the type maps in infoDictionary from the very beginning.  I only use the type presented at creation and add sub maps if they are needed.\r\n3) You look for the . between properties, where as the original, which I didn't change, map the expression and recursively map the body, which is not guaranteed to be a property.  ```p => p.Children.First(c => c.Id > 10).Id``` might not work because it's a member expression but its body is a method expression.\r\n4) Mine modifies the original expression mapping  All benefits of UseAsDataSource() go into ExpressionMapper as well.  Yours is a brand new expression mapper, meaning either ExpressionMapper goes away, or you have to replace the expression visitor it uses with your own, or maintain 2 sets of ExpressionVisitors.\r\n5)  You made meaningful exception methods on unsupported cases.  Mine has no meaningful exception handling anywhere."}}