public DateTime Resolve(UserModel source, T destination, DateTime destMember, ResolutionContext context) { var stringDateTime = m_userDataStringValueResolver.Resolve(source, destination, null, context); if (stringDateTime == null) { return(default(DateTime)); } try { var dateTime = DateTimeStringMapper.StringToDate(stringDateTime); return(dateTime); } catch (ArgumentException) { return(m_formatProvider != null?DateTime.Parse(stringDateTime, m_formatProvider) : default(DateTime)); } }
public DateTime StringToDate(string dateString) { return(DateTimeStringMapper.StringToDate(dateString)); }