{"action":"closed","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/773","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/773/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/773/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/773/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/773","id":93599122,"number":773,"title":"Support of Projected Filtering in Nested DTO with ExplicitExpansion","user":{"login":"jvitor83","id":3493339,"avatar_url":"https://avatars.githubusercontent.com/u/3493339?v=3","gravatar_id":"","url":"https://api.github.com/users/jvitor83","html_url":"https://github.com/jvitor83","followers_url":"https://api.github.com/users/jvitor83/followers","following_url":"https://api.github.com/users/jvitor83/following{/other_user}","gists_url":"https://api.github.com/users/jvitor83/gists{/gist_id}","starred_url":"https://api.github.com/users/jvitor83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvitor83/subscriptions","organizations_url":"https://api.github.com/users/jvitor83/orgs","repos_url":"https://api.github.com/users/jvitor83/repos","events_url":"https://api.github.com/users/jvitor83/events{/privacy}","received_events_url":"https://api.github.com/users/jvitor83/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-07T18:37:40Z","updated_at":"2015-07-08T18:10:09Z","closed_at":"2015-07-08T18:10:09Z","body":"Consider the following scenario:\r\n\r\n\r\n```csharp\r\nvoid Main()\r\n{\r\n\tvar mappingFather = AutoMapper.Mapper.CreateMap<Father, FatherDTO>();\r\n\tmappingFather.ForAllMembers(r => r.Ignore());\r\n\tmappingFather.ForMember(dest => dest.IdDTO, opt => opt.MapFrom(src => src.Id));\r\n\tmappingFather.ForMember(dest => dest.NameDTO, opt => opt.MapFrom(src => src.Name));\r\n\tmappingFather.ForMember(dest => dest.ChildrenDTO, opt => {\r\n\t\topt.MapFrom(src => src.Children);\r\n\t\topt.ExplicitExpansion();\r\n\t});\r\n\t\r\n\tvar mappingSon = AutoMapper.Mapper.CreateMap<Son, SonDTO>();\r\n\tmappingSon.ForAllMembers(r => r.Ignore());\r\n\tmappingSon.ForMember(dest => dest.IdDTO, opt => opt.MapFrom(src => src.Id));\r\n\tmappingSon.ForMember(dest => dest.NameDTO, opt => opt.MapFrom(src => src.Name));\r\n\r\n\t\r\n\tTestContext context = new TestContext();\r\n\t\r\n\tIQueryable<Father> fathers = context.Fathers;\r\n\t\r\n\tIQueryable<FatherDTO> fathersDTO = fathers.Project().To<FatherDTO>(membersToExpand: \"Children\");\r\n\t\r\n\tIQueryable<FatherDTO> fathersWithSonsNameAsJohnQueryable = fathersDTO.Where(f => f.ChildrenDTO.Any(c => c.NameDTO == \"John\"));\r\n\t\r\n\tList<FatherDTO> fathersWithSonsNameAsJohnExecuted = fathersWithSonsNameAsJohnQueryable.ToList(); //NotSupportedException\r\n\t\r\n}\r\n\r\npublic class TestContext : System.Data.Entity.DbContext\r\n{\r\n\tpublic TestContext() : base(@\"Server=(localdb)\\v11.0;Integrated Security=true;AttachDbFileName=C:\\Windows\\temp\\Temp.mdf;\")\r\n\t{\r\n\t\tDatabase.SetInitializer<TestContext>(new System.Data.Entity.DropCreateDatabaseAlways<TestContext>());\r\n\t}\r\n\tpublic DbSet<Father> Fathers { get; set; }\r\n\tpublic DbSet<Son> Children { get; set; }\r\n}\r\n\r\npublic class FatherDTO\r\n{\r\n\tpublic FatherDTO()\r\n\t{\r\n\t\tthis.ChildrenDTO = (ICollection<SonDTO>)new HashSet<SonDTO>();\r\n\t}\r\n\tpublic int IdDTO { get; set; }\r\n\tpublic string NameDTO { get; set; }\r\n\t\r\n\tpublic ICollection<SonDTO> ChildrenDTO { get; set; }\r\n}\r\n\r\npublic class SonDTO\r\n{\r\n\tpublic int IdDTO { get; set; }\r\n\tpublic string NameDTO { get; set; }\r\n}\r\n\r\npublic class Father\r\n{\r\n\tpublic Father()\r\n\t{\r\n\t\tthis.Children = (ICollection<Son>)new HashSet<Son>();\r\n\t}\r\n\tpublic int Id { get; set; }\r\n\tpublic string Name { get; set; }\r\n\t\r\n\tpublic ICollection<Son> Children { get; set; }\r\n}\r\n\r\npublic class Son\r\n{\r\n\tpublic int Id { get; set; }\r\n\tpublic string Name { get; set; }\r\n}\r\n```\r\n\r\nWith ExplicitExpansion the Where filter in the Children is not supported.\r\nOnce you remove the ExplictExpansion it works."}}