Example #1
0
        public void UseCustomSerializer_registers_serializer_type(LambdaConfigurator configurator)
        {
            configurator.UseCustomSerializer <SystemTextJsonSerializer>();

            var sp = configurator.Services.BuildServiceProvider();

            var serializer = sp.GetService <ISerializer>();

            Assert.That(serializer, Is.InstanceOf <SystemTextJsonSerializer>());
        }
 protected override IMetadata GetMetadata()
 {
     var c = new LambdaConfigurator();
     c.Register<TestAction>("TestAction.doEcho", x => x.DoEcho(default(string)));
     c.Register<TestAction>("TestAction.multiply", x => x.Multiply(default(double)));
     c.Register<TestAction>("TestAction.getGrid", x => x.GetGrid(default(TestAction.GetGridParams)));
     c.Register<TestAction>("TestAction.getTree", x => x.GetTree(default(string)));
     c.Register<TestAction>("TestAction.showDetails", x => x.ShowDetails(default(string), default(string), default(int)), namedArguments: true);
     c.Register<Profile>("Profile.getBasicInfo", x => x.GetBasicInfo(default(int), default(string)));
     c.Register<Profile>("Profile.getPhoneInfo", x => x.GetPhoneInfo(default(int)));
     c.Register<Profile>("Profile.getLocationInfo", x => x.GetLocationInfo(default(int)));
     c.Register<Profile>("Profile.updateBasicInfo", x => x.UpdateBasicInfo(default(string), default(string), default(string), default(string), default(string)), formHandler: true);
     return c;
 }
Example #3
0
        protected void Application_Start(object sender, EventArgs e)
        {
            //DirectHttpHandler.SetMetadata(new ReflectionConfigurator()
            //                                        .RegisterType<TestAction>()
            //                                        .RegisterType<Profile>());

            var c = new LambdaConfigurator();
            c.Register<TestAction>("TestAction.doEcho", x => x.DoEcho(default(string)));
            c.Register<TestAction>("TestAction.multiply", x => x.Multiply(default(double)));
            c.Register<TestAction>("TestAction.getGrid", x => x.GetGrid(default(TestAction.GetGridParams)));
            c.Register<TestAction>("TestAction.getTree", x => x.GetTree(default(string)));
            c.Register<TestAction>("TestAction.showDetails", x => x.ShowDetails(default(string), default(string), default(int)), namedArguments: true);
            c.Register<Profile>("Profile.getBasicInfo", x => x.GetBasicInfo(default(int), default(string)));
            c.Register<Profile>("Profile.getPhoneInfo", x => x.GetPhoneInfo(default(int)));
            c.Register<Profile>("Profile.getLocationInfo", x => x.GetLocationInfo(default(int)));
            c.Register<Profile>("Profile.updateBasicInfo", x => x.UpdateBasicInfo(default(string), default(string), default(string), default(string), default(string)), formHandler: true);
            DirectHttpHandler.SetMetadata(c);
        }
Example #4
0
        protected void Application_Start(object sender, EventArgs e)
        {
            //DirectHttpHandler.SetMetadata(new ReflectionConfigurator()
            //                                        .RegisterType<TestAction>()
            //                                        .RegisterType<Profile>());

            var c = new LambdaConfigurator();

            c.Register <TestAction>("TestAction.doEcho", x => x.DoEcho(default(string)));
            c.Register <TestAction>("TestAction.multiply", x => x.Multiply(default(double)));
            c.Register <TestAction>("TestAction.getGrid", x => x.GetGrid(default(TestAction.GetGridParams)));
            c.Register <TestAction>("TestAction.getTree", x => x.GetTree(default(string)));
            c.Register <TestAction>("TestAction.showDetails", x => x.ShowDetails(default(string), default(string), default(int)), namedArguments: true);
            c.Register <Profile>("Profile.getBasicInfo", x => x.GetBasicInfo(default(int), default(string)));
            c.Register <Profile>("Profile.getPhoneInfo", x => x.GetPhoneInfo(default(int)));
            c.Register <Profile>("Profile.getLocationInfo", x => x.GetLocationInfo(default(int)));
            c.Register <Profile>("Profile.updateBasicInfo", x => x.UpdateBasicInfo(default(string), default(string), default(string), default(string), default(string)), formHandler: true);
            DirectHttpHandler.SetMetadata(c);
        }
 public void SetUp()
 {
     _target = new LambdaConfigurator();
 }
 public void SetUp()
 {
     _target = new LambdaConfigurator();
 }