Beispiel #1
0
            public override PhpTypeCode Emit(LinqBuilder /*!*/ builder)
            {
                ILEmitter il = builder.IL;

                // source expected on stack

                // NEW Func[object,object](<linq context>, <&lambda>);
                builder.EmitLoadLinqContext();
                il.Emit(OpCodes.Ldftn, builder.EmitLambda(string.Format("<Predicate_{0}>",
                                                                        builder.GetNextPredicateNum()), valueVar, predicate, PhpTypeCode.Boolean));
                il.Emit(OpCodes.Newobj, LinqExterns.Func2_object_bool_ctor);

                // LOAD Where[object](<source>, <delegate>);
                il.Emit(OpCodes.Call, LinqExterns.Where);
                //il.Emit(OpCodes.Call, Methods.Operators.Where);

                return(base.Emit(builder));
            }