Exemple #1
0
        private bool UseWhenProperty(string firstColumnName)
        {
            _info = PropertyInfoHelper.GetCaseInsensitivePropertyInfo(
                TargetType, firstColumnName);

            if (_info != null)
            {
                return(true);
            }

            _info = PropertyInfoHelper.GetIndexerPropertyInfo(
                TargetType, firstColumnName);

            if (_info == null)
            {
                return(false);
            }

            _isIndexer = true;

            var parameterType = _info.GetIndexParameters().First().ParameterType;

            _lookUp = Convert.ChangeType(firstColumnName, parameterType);

            return(true);
        }
Exemple #2
0
        public override bool UseWhen()
        {
            _info = PropertyInfoHelper.GetIndexerPropertyInfo(TargetType, ColumnName);

            if (_info == null)
            {
                return(false);
            }

            var parameterType = _info.GetIndexParameters().First().ParameterType;

            _lookUp = Convert.ChangeType(ColumnName, parameterType);

            return(true);
        }