{"action":"created","issue":{"url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/1191","repository_url":"https://api.github.com/repos/JoshClose/CsvHelper","labels_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/1191/labels{/name}","comments_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/1191/comments","events_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/1191/events","html_url":"https://github.com/JoshClose/CsvHelper/issues/1191","id":391322270,"node_id":"MDU6SXNzdWUzOTEzMjIyNzA=","number":1191,"title":"ConvertUsing ArgumentException","user":{"login":"LGreenberger","id":16126495,"node_id":"MDQ6VXNlcjE2MTI2NDk1","avatar_url":"https://avatars0.githubusercontent.com/u/16126495?v=4","gravatar_id":"","url":"https://api.github.com/users/LGreenberger","html_url":"https://github.com/LGreenberger","followers_url":"https://api.github.com/users/LGreenberger/followers","following_url":"https://api.github.com/users/LGreenberger/following{/other_user}","gists_url":"https://api.github.com/users/LGreenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/LGreenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LGreenberger/subscriptions","organizations_url":"https://api.github.com/users/LGreenberger/orgs","repos_url":"https://api.github.com/users/LGreenberger/repos","events_url":"https://api.github.com/users/LGreenberger/events{/privacy}","received_events_url":"https://api.github.com/users/LGreenberger/received_events","type":"User","site_admin":false},"labels":[{"id":81846939,"node_id":"MDU6TGFiZWw4MTg0NjkzOQ==","url":"https://api.github.com/repos/JoshClose/CsvHelper/labels/question","name":"question","color":"fbca04","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-15T00:25:06Z","updated_at":"2018-12-15T04:13:01Z","closed_at":null,"author_association":"NONE","body":"I am getting an exception when writing to a csv file when I add a ``ConvertUsing`` to ``Map(m => m.Link)``. ``NotesAuditable.Link`` is a string type. No exception occurs when ``ConvertUsing`` is removed. Am I not allowed to use it for transposing a string property before writing it out?\r\n\r\n```\r\n    public class BugReportMap : ClassMap<BugReport>\r\n    {\r\n        public BugReportMap()\r\n        {\r\n            Map(m => m.BugId);\r\n            Map(m => m.Summary);\r\n            Map(m => m.Severity);\r\n            Map(m => m.ImpactOnBusiness);\r\n            Map(m => m.FilersPriority);\r\n            Map(m => m.CostToBusiness);\r\n            Map(m => m.IsDocumentation);\r\n            Map(m => m.IsHardware);\r\n            Map(m => m.Reproduciblity);\r\n            Map(m => m.DateEntered); // .TypeConverter<NullableConverter>().TypeConverterOption.Format(\"o\");\r\n            Map(m => m.WhoFound);\r\n            Map(m => m.ReportedBy);\r\n            Map(m => m.OriginatorSource);\r\n\r\n            References<ProductInfoMap>(m => m.ProductInfo);\r\n            Map(m => m.IsLikelyOnOtherModels);\r\n\r\n            Map(m => m.DetailedDescription);\r\n            Map(m => m.StepsToReproduce);\r\n            Map(m => m.RelatedBugs);\r\n            Map(m => m.FileAttachments);\r\n            Map(m => m.InstantReplayScript);\r\n\r\n            References<BugManagementMap>(m => m.Management);\r\n            References<NotesAuditableMap>(m => m.Auditable);\r\n        }\r\n    }\r\n\r\n    public class NotesAuditableMap : ClassMap<NotesAuditable>\r\n    {\r\n        public NotesAuditableMap()\r\n        {\r\n            Map(m => m.Revised);\r\n            Map(m => m.Modified);\r\n            Map(m => m.Link).ConvertUsing(m => $\"=HYPERLINK(\\\"{m.Link}\\\")\"); // This causes an exception.\r\n        }\r\n    }\r\n\r\nArgumentException: Expression of type 'BugBase.Notes.BugReport' cannot be used for parameter of type 'BugBase.Notes.NotesAuditable'"},"comment":{"url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/comments/447535665","html_url":"https://github.com/JoshClose/CsvHelper/issues/1191#issuecomment-447535665","issue_url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/1191","id":447535665,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzUzNTY2NQ==","user":{"login":"JoshClose","id":114971,"node_id":"MDQ6VXNlcjExNDk3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/114971?v=4","gravatar_id":"","url":"https://api.github.com/users/JoshClose","html_url":"https://github.com/JoshClose","followers_url":"https://api.github.com/users/JoshClose/followers","following_url":"https://api.github.com/users/JoshClose/following{/other_user}","gists_url":"https://api.github.com/users/JoshClose/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshClose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshClose/subscriptions","organizations_url":"https://api.github.com/users/JoshClose/orgs","repos_url":"https://api.github.com/users/JoshClose/repos","events_url":"https://api.github.com/users/JoshClose/events{/privacy}","received_events_url":"https://api.github.com/users/JoshClose/received_events","type":"User","site_admin":false},"created_at":"2018-12-15T04:13:01Z","updated_at":"2018-12-15T04:13:01Z","author_association":"OWNER","body":"No, I still don't see a way of doing it. The expression comes from the `ConvertUsing` parameter which is tied to a property already. I'd have to build up a new expression tree or something. I'm fine with there being the caveat of `ConvertUsing doesn't work if you use References`, since this isn't the intended way of doing it anyways."}}
{"actor":{"display_login":"JoshClose"}}