コード例 #1
0
        public Expression Change(Expression sourceExpression)
        {
            Type        returnType     = ((MethodCallExpression)sourceExpression).Method.ReturnType;
            List <Type> typesToReplace = new InstantiatedTypeSearcher().Find(sourceExpression);

            var expression = new NullableReplacer(typesToReplace).Visit(sourceExpression);

            //TODO refactor this
            var maxNewNestDeep = new NewNestingCounter().FindCount(sourceExpression);

            expression = new FinalSelectAdder().AddFinalSelect(expression, returnType, typesToReplace, maxNewNestDeep);
            expression = new NullComparisonChanger().Visit(expression);

            return(expression);
        }
コード例 #2
0
        public Expression Change(Expression sourceExpression)
        {
            Type returnType = ((MethodCallExpression)sourceExpression).Method.ReturnType;
            List<Type> typesToReplace = new InstantiatedTypeSearcher().Find(sourceExpression);

            var expression = new NullableReplacer(typesToReplace).Visit(sourceExpression);

            //TODO refactor this
            var maxNewNestDeep = new NewNestingCounter().FindCount(sourceExpression);

            expression = new FinalSelectAdder().AddFinalSelect(expression, returnType, typesToReplace, maxNewNestDeep);
            expression = new NullComparisonChanger().Visit(expression);

            return expression;
        }