示例#1
0
        internal void AutoMapColumnsAction <T>(params Expression <Func <T, object> >[] ignorePropertyExpressions)
        {
            VerifyAutoMapAlreadyCalled();

            var properties          = ReflectionHelper.GetProperties(_data.Item.GetType());
            var ignorePropertyNames = new HashSet <string>();

            if (ignorePropertyExpressions != null)
            {
                foreach (var ignorePropertyExpression in ignorePropertyExpressions)
                {
                    var ignorePropertyName = new PropertyExpressionParser <T>(_data.Item, ignorePropertyExpression).Name;
                    ignorePropertyNames.Add(ignorePropertyName);
                }
            }

            foreach (var property in properties)
            {
                var ignoreProperty = ignorePropertyNames.SingleOrDefault(x => x.Equals(property.Value.Name, StringComparison.CurrentCultureIgnoreCase));
                if (ignoreProperty != null)
                {
                    continue;
                }

                var propertyType = ReflectionHelper.GetPropertyType(property.Value);

                var propertyValue = ReflectionHelper.GetPropertyValue(_data.Item, property.Value);
                ColumnAction(property.Value.Name, propertyValue, propertyType, DataTypes.Object, 0);
            }
        }
示例#2
0
        internal void AutoMapColumnsAction <T>(params Expression <Func <T, object> >[] ignorePropertyExpressions)
        {
            method_1();
            Dictionary <string, PropertyInfo> properties = ReflectionHelper.GetProperties(builderData_0.Item.GetType());
            HashSet <string> hashSet = new HashSet <string>();

            if (ignorePropertyExpressions != null)
            {
                foreach (Expression <Func <T, object> > propertyExpression in ignorePropertyExpressions)
                {
                    string name = new PropertyExpressionParser <T>(builderData_0.Item, propertyExpression).Name;
                    hashSet.Add(name);
                }
            }
            using (Dictionary <string, PropertyInfo> .Enumerator enumerator = properties.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Func <string, bool> func = null;
                    KeyValuePair <string, PropertyInfo> property = enumerator.Current;
                    HashSet <string> source = hashSet;
                    func = delegate(string x)
                    {
                        KeyValuePair <string, PropertyInfo> keyValuePair4 = property;
                        return(x.Equals(keyValuePair4.Value.Name, StringComparison.CurrentCultureIgnoreCase));
                    };
                    string text = source.SingleOrDefault(func);
                    if (text == null)
                    {
                        KeyValuePair <string, PropertyInfo> keyValuePair = property;
                        Type   propertyType = ReflectionHelper.GetPropertyType(keyValuePair.Value);
                        object item         = builderData_0.Item;
                        KeyValuePair <string, PropertyInfo> keyValuePair2 = property;
                        object propertyValue = ReflectionHelper.GetPropertyValue(item, keyValuePair2.Value);
                        KeyValuePair <string, PropertyInfo> keyValuePair3 = property;
                        method_0(keyValuePair3.Value.Name, propertyValue, propertyType, DataTypes.Object, 0);
                    }
                }
            }
        }
示例#3
0
        internal void ColumnValueAction <T>(Expression <Func <T, object> > expression, DataTypes parameterType, int size)
        {
            var parser = new PropertyExpressionParser <T>(_data.Item, expression);

            ColumnAction(parser.Name, parser.Value, parser.Type, parameterType, size);
        }
示例#4
0
        internal void ColumnValueAction <T>(Expression <Func <T, object> > expression, bool propertyNameIsParameterName)
        {
            var parser = new PropertyExpressionParser <T>(_data.Item, expression);

            ColumnAction(parser.Name, parser.Value, parser.Type, propertyNameIsParameterName);
        }
示例#5
0
        internal void WhereAction <T>(Expression <Func <T, object> > expression)
        {
            var parser = new PropertyExpressionParser <T>(_data.Item, expression);

            WhereAction(parser.Name, parser.Value);
        }
示例#6
0
        internal void ColumnValueAction <T>(Expression <Func <T, object> > expression, DataTypes parameterType, int size)
        {
            PropertyExpressionParser <T> propertyExpressionParser = new PropertyExpressionParser <T>(builderData_0.Item, expression);

            method_0(propertyExpressionParser.Name, propertyExpressionParser.Value, propertyExpressionParser.Type, parameterType, size);
        }