コード例 #1
0
        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));
            }
        }
コード例 #2
0
 public DateTime StringToDate(string dateString)
 {
     return(DateTimeStringMapper.StringToDate(dateString));
 }