{"action":"created","issue":{"url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/526","repository_url":"https://api.github.com/repos/JoshClose/CsvHelper","labels_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/526/comments","events_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/526/events","html_url":"https://github.com/JoshClose/CsvHelper/issues/526","id":155480001,"number":526,"title":" this.Map(x => x.Foo.Bar).Name(\"bar\"); fails (subproperty support)","user":{"login":"asd-and-Rizzo","id":757125,"avatar_url":"https://avatars.githubusercontent.com/u/757125?v=3","gravatar_id":"","url":"https://api.github.com/users/asd-and-Rizzo","html_url":"https://github.com/asd-and-Rizzo","followers_url":"https://api.github.com/users/asd-and-Rizzo/followers","following_url":"https://api.github.com/users/asd-and-Rizzo/following{/other_user}","gists_url":"https://api.github.com/users/asd-and-Rizzo/gists{/gist_id}","starred_url":"https://api.github.com/users/asd-and-Rizzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asd-and-Rizzo/subscriptions","organizations_url":"https://api.github.com/users/asd-and-Rizzo/orgs","repos_url":"https://api.github.com/users/asd-and-Rizzo/repos","events_url":"https://api.github.com/users/asd-and-Rizzo/events{/privacy}","received_events_url":"https://api.github.com/users/asd-and-Rizzo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-05-18T11:39:00Z","updated_at":"2016-08-25T08:44:38Z","closed_at":"2016-08-25T04:57:53Z","body":"```\r\n this.Map(x => x.Foo.Bar).Name(\"bar\");\r\n```\r\n\r\n```\r\nProperty 'System.String bar' is not defined for type ...\r\n```\r\n\r\nI think this should work when I explicitly stated `Name`."},"comment":{"url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/comments/242319139","html_url":"https://github.com/JoshClose/CsvHelper/issues/526#issuecomment-242319139","issue_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/526","id":242319139,"user":{"login":"asd-and-Rizzo","id":757125,"avatar_url":"https://avatars.githubusercontent.com/u/757125?v=3","gravatar_id":"","url":"https://api.github.com/users/asd-and-Rizzo","html_url":"https://github.com/asd-and-Rizzo","followers_url":"https://api.github.com/users/asd-and-Rizzo/followers","following_url":"https://api.github.com/users/asd-and-Rizzo/following{/other_user}","gists_url":"https://api.github.com/users/asd-and-Rizzo/gists{/gist_id}","starred_url":"https://api.github.com/users/asd-and-Rizzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asd-and-Rizzo/subscriptions","organizations_url":"https://api.github.com/users/asd-and-Rizzo/orgs","repos_url":"https://api.github.com/users/asd-and-Rizzo/repos","events_url":"https://api.github.com/users/asd-and-Rizzo/events{/privacy}","received_events_url":"https://api.github.com/users/asd-and-Rizzo/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T08:44:38Z","updated_at":"2016-08-25T08:44:38Z","body":"Please reopen:\r\n```\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace csv\r\n{\r\n    class Program\r\n    {\r\n        public class A\r\n        {\r\n            public B PropA { get; set; }\r\n        }\r\n\r\n        public class B\r\n        {\r\n            public C PropB { get; set; }\r\n        }\r\n\r\n        public class C\r\n        {\r\n            public string Val { get; set; }\r\n        }\r\n\r\n        public class MyMap : CsvHelper.Configuration.CsvClassMap<A>\r\n        {\r\n            public MyMap()\r\n            {\r\n                this.Map(x => x.PropA.PropB.Val).Name(\"BlaBla\");\r\n            }\r\n        }\r\n\r\n        static void Main(string[] args)\r\n        {\r\n            Console.WriteLine(Environment.Version);\r\n            Console.WriteLine(typeof(CsvHelper.CsvFactory).Assembly.FullName);\r\n            var conf = new CsvHelper.Configuration.CsvConfiguration();\r\n            conf.RegisterClassMap<MyMap>();\r\n            var wr = new StringWriter();\r\n            var csv = new CsvHelper.CsvWriter(wr, conf);\r\n            // NEXT WORKS WHICH IS WRONG - BOTH SHOULD FAIL OF BOTH SHOULD WORK!!!!\r\n            //var csv = new CsvHelper.CsvWriter(wr);\r\n            csv.WriteHeader<A>();\r\n            csv.WriteRecord(new A() { PropA = new B { PropB = new C { Val = \"c\" } } });\r\n            wr.Flush();\r\n            Console.WriteLine(wr);\r\n        }\r\n    }\r\n}\r\n```\r\nGives\r\n```\r\n4.0.30319.42000\r\nCsvHelper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823\r\nUnhandled Exception: System.ArgumentException: Property 'System.String Val' is not defined for type 'csv.Program+A'\r\n   at System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property)\r\n   at CsvHelper.CsvWriter.CreatePropertyExpression(Expression recordExpression, CsvClassMap mapping, CsvPropertyMap propertyMap) in C:\\Users\\Josh\\Projects\\CsvHelper\\src\\CsvHelper\\CsvWriter.cs:line 568\r\n   at CsvHelper.CsvWriter.CreateActionForObject(Type type) in C:\\Users\\Josh\\Projects\\CsvHelper\\src\\CsvHelper\\CsvWriter.cs:line 747\r\n   at CsvHelper.CsvWriter.CreateWriteRecordAction(Type type) in C:\\Users\\Josh\\Projects\\CsvHelper\\src\\CsvHelper\\CsvWriter.cs:line 710\r\n   at CsvHelper.CsvWriter.GetWriteRecordAction[T]() in C:\\Users\\Josh\\Projects\\CsvHelper\\src\\CsvHelper\\CsvWriter.cs:line 668\r\n   at CsvHelper.CsvWriter.WriteRecord[T](T record) in C:\\Users\\Josh\\Projects\\CsvHelper\\src\\CsvHelper\\CsvWriter.cs:line 399\r\n   at csv.Program.Main(String[] args) in G:\\src\\clr\\data\\csv\\csv\\Program.cs:line 46\r\n```\r\n\r\nBut without config:\r\n```\r\n     var csv = new CsvHelper.CsvWriter(wr);\r\n```\r\nI am fine\r\n```\r\n4.0.30319.42000\r\nCsvHelper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823\r\nVal\r\nc\r\n```\r\n\r\nI expect that both things to work - with and without config. If first version with config does not work and your insist it should not - then without config should not work either. If first version does not work it should throw other exception - suggesting what to do - like flat out model or use references.\r\n\r\nBut as I said - references DO NOT ALLOW INTERMINGLE COLUMNS AS I WANT!\r\n\r\n\r\n"}}
{"actor":{"display_login":"asd-and-Rizzo"}}