コード例 #1
0
        public void one_in_one_out()
        {
            MethodInfo method = type.GetMethod("OneInOneOut");
            var        func   = FuncBuilder.ToFunc(type, method).ShouldBeOfType <Func <PropertyTarget, int, string> >();

            func(new PropertyTarget(), 123).ShouldEqual("123");
        }
コード例 #2
0
        private ValueDependency createLambda()
        {
            object lambda = HasOutput
                                ? FuncBuilder.ToFunc(HandlerType, Method)
                                : FuncBuilder.ToAction(HandlerType, Method);

            return(new ValueDependency(lambda.GetType(), lambda));
        }
コード例 #3
0
        public void zero_in_one_out()
        {
            MethodInfo method = type.GetMethod("ZeroInOneOut");
            var        func   = FuncBuilder.ToFunc(type, method).ShouldBeOfType <Func <PropertyTarget, string> >();

            var target = new PropertyTarget();

            func(target).ShouldEqual(target.ZeroInOneOut());
        }
コード例 #4
0
ファイル: ActionCallBase.cs プロジェクト: maniacs-sfa/fubumvc
        protected override IConfiguredInstance buildInstance()
        {
            Validate();

            var instance = new ConfiguredInstance(determineHandlerType());
            var lambda   = HasOutput
                ? FuncBuilder.ToFunc(HandlerType, Method)
                : FuncBuilder.ToAction(HandlerType, Method);

            instance.Dependencies.Add(lambda.GetType(), lambda);


            return(instance);
        }