Exemple #1
0
        public void Visit(GenericDictionaryValueGetter getter)
        {
            var containsKeyMethod = getter.DictionaryType.GetMethod("ContainsKey");

            CompiledGetter =
                Expression.Condition(
                    Expression.Call(_dataParameter, containsKeyMethod, Expression.Constant(getter.Key)),
                    Expression.Call(_dataParameter, getter.GetMethod, Expression.Constant(getter.Key)),
                    Expression.Default(getter.GetMethod.ReturnType));
        }
        public void Visit(GenericDictionaryValueGetter getter)
        {
            var containsKeyMethod = getter.DictionaryType.GetMethod("ContainsKey");

            CompiledGetter =
                Expression.Condition(
                    Expression.Call(_dataParameter, containsKeyMethod, Expression.Constant(getter.Key)),
                    Expression.Call(_dataParameter, getter.GetMethod, Expression.Constant(getter.Key)),
                    Expression.Default(getter.GetMethod.ReturnType));
        }