Ejemplo n.º 1
0
        public UserAddressingWays Resolve(UserModel source, T destination, UserAddressingWays destMember, ResolutionContext context)
        {
            var stringUserTitle = m_userDataStringValueResolver.Resolve(source, destination, null, context);

            if (stringUserTitle == null)
            {
                return(UserAddressingWays.None);
            }

            return(Enum.TryParse <UserAddressingWays>(stringUserTitle, out var userTitle) ? userTitle : UserAddressingWays.None);
        }
Ejemplo n.º 2
0
        public Guid?Resolve(UserModel source, T destination, Guid?destMember, ResolutionContext context)
        {
            var stringMasterUserId = m_userDataStringValueResolver.Resolve(source, destination, null, context);

            if (stringMasterUserId == null)
            {
                return(null);
            }

            return(Guid.Parse(stringMasterUserId));
        }
Ejemplo n.º 3
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));
            }
        }