{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1425","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1425/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1425/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1425/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1425","id":163380364,"number":1425,"title":"Automapper 5.0 - Custom type converters for Nullable type and throw exception on add profile","user":{"login":"aligorji","id":8667938,"avatar_url":"https://avatars.githubusercontent.com/u/8667938?v=3","gravatar_id":"","url":"https://api.github.com/users/aligorji","html_url":"https://github.com/aligorji","followers_url":"https://api.github.com/users/aligorji/followers","following_url":"https://api.github.com/users/aligorji/following{/other_user}","gists_url":"https://api.github.com/users/aligorji/gists{/gist_id}","starred_url":"https://api.github.com/users/aligorji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aligorji/subscriptions","organizations_url":"https://api.github.com/users/aligorji/orgs","repos_url":"https://api.github.com/users/aligorji/repos","events_url":"https://api.github.com/users/aligorji/events{/privacy}","received_events_url":"https://api.github.com/users/aligorji/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-01T11:54:14Z","updated_at":"2016-07-01T12:38:49Z","closed_at":null,"body":"````\r\npublic class WebApiApplication : HttpApplication\r\n    {\r\n        protected void Application_Start()\r\n        {\r\n            AutoMapper.Mapper.Initialize(cfg =>\r\n            {\r\n                cfg.AddProfile<FooProfile>(); //Expression of type 'System.DateTime' cannot be used for parameter of type 'System.Nullable`1[System.DateTime]'\r\n            });\r\n\r\n            Source source = new Source\r\n            {\r\n                Date = DateTime.Now\r\n            };\r\n\r\n            Destination dest = AutoMapper.Mapper.Map<Source, Destination>(source);\r\n        }\r\n\r\n    }\r\n\r\n    public class Source\r\n    {\r\n        public DateTime Date { get; set; }\r\n    }\r\n\r\n\r\n    public class Destination\r\n    {\r\n        public string Date { get; set; }\r\n    }\r\n\r\n\r\n\r\n\r\n    public class FooProfile : BaseProfile\r\n    {\r\n\r\n        public FooProfile()\r\n        {\r\n            CreateMap<Source, Destination>();\r\n        }\r\n    }\r\n\r\n\r\n\r\n    public abstract class BaseProfile : AutoMapper.Profile\r\n    {\r\n\r\n        protected BaseProfile()\r\n        {\r\n\r\n            CreateMap<DateTime, string>().ConvertUsing(new DateTimeToString());\r\n\r\n            CreateMap<DateTime?, string>().ConvertUsing(new DateTimeNullableToString());\r\n\r\n        }\r\n\r\n        public class DateTimeNullableToString : ITypeConverter<DateTime?, string>\r\n        {\r\n            public string Convert(DateTime? source, ResolutionContext context)\r\n            {\r\n                return source.HasValue\r\n                    ? source.Value.ToLongDateString()\r\n                    : null;\r\n            }\r\n        }\r\n\r\n        public class DateTimeToString : ITypeConverter<DateTime, string>\r\n        {\r\n            public string Convert(DateTime source, ResolutionContext context)\r\n            {\r\n                return source.ToLongDateString();\r\n            }\r\n        }\r\n\r\n\r\n    }\r\n````\r\n\r\nException on ````cfg.AddProfile<FooProfile>();```` ... Of course in version 5.\r\nwhen comment this line it's worked!!!\r\n\r\n````CreateMap<DateTime?, string>().ConvertUsing(new DateTimeNullableToString());````"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/229936300","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1425#issuecomment-229936300","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1425","id":229936300,"user":{"login":"lbargaoanu","id":4517428,"avatar_url":"https://avatars.githubusercontent.com/u/4517428?v=3","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":"2016-07-01T12:38:49Z","updated_at":"2016-07-01T12:38:49Z","body":"Try the MyGet build."}}
{"actor":{"display_login":"lbargaoanu"}}