Пример #1
0
        public override void InitalizeData()
        {
            Message = _helloService.SayHello();



            base.InitalizeData();
        }
Пример #2
0
        public async Task <IActionResult> Get(string firstName)
        {
            // This is a "mock", just to trigger BadRequest response
            if (firstName == "400")
            {
                throw new ValidationException("First name must not be 400");
            }

            var result = await _service.SayHello(firstName);

            return(Ok(result));
        }
Пример #3
0
        public async Task <IActionResult> GetNestedApp1V1Values()
        {
            _helloService.SayHello();
            _globalHelloService.SayHello();
            var request = new ValueRequest()
            {
                AppIndex        = 1,
                EndpointVersion = 1
            };
            var results = await _mediator.Send(request);

            return(await Task.FromResult <IActionResult>(Ok( results )));
        }
Пример #4
0
        public async Task <IActionResult> Index()
        {
            _helloService.SayHello();
            var routes = _actionDescriptorCollectionProvider.ActionDescriptors.Items.Select(x => new {
                Action     = x.RouteValues["Action"],
                Controller = x.RouteValues["Controller"],
                x.AttributeRouteInfo?.Name,
                x.AttributeRouteInfo?.Template,
                x.ActionConstraints,
                x.RouteValues,
                x.AttributeRouteInfo
            }).ToList();

            return(await Task.FromResult <IActionResult>(Ok( routes )));
        }
Пример #5
0
        public static void Main()
        {
            AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

            IWindsorContainer container = null;

            try
            {
                container = GetContainer();

                var service = container.Resolve <IHelloService>();
                Console.WriteLine(service.SayHello("world"));
                container.Release(service);


                var factory = new ChannelFactory <IHelloService>(new NetTcpBinding());
                try
                {
                    IHelloService channel = factory.CreateChannel(new EndpointAddress("net.tcp://localhost:9101/hello"));
                    using (var clientChannel = channel as IClientChannel)
                    {
                        channel.SayHello("world");
                        clientChannel.Close();
                    }
                }
                finally
                {
                    factory.Close();
                }
            }
            finally
            {
                if (container != null)
                {
                    container.Dispose();
                }
            }
            Console.ReadLine();
        }
Пример #6
0
        static void Main(string[] args)
        {
            try
            {
                // Create binding for the service endpoint.
                CustomBinding amqpBinding = new CustomBinding();
                amqpBinding.Elements.Add(new BinaryMessageEncodingBindingElement());
                amqpBinding.Elements.Add(new AmqpTransportBindingElement());

                // Create endpoint address.
                Uri             amqpClientUri   = new Uri("amqp:amq.direct?routingkey=routing_key");
                EndpointAddress endpointAddress = new EndpointAddress(amqpClientUri);

                // Create a client with given client endpoint configuration.
                ChannelFactory <IHelloService> channelFactory = new ChannelFactory <IHelloService>(amqpBinding, endpointAddress);
                IHelloService clientProxy = channelFactory.CreateChannel();

                Console.WriteLine();

                string name = "name";
                for (int i = 0; i < 5; i++)
                {
                    Console.WriteLine("Sending message: " + name + (i + 1));
                    clientProxy.SayHello(name + (i + 1));
                }

                Console.WriteLine();
                Console.WriteLine("Press <ENTER> to terminate client.");
                Console.ReadLine();

                channelFactory.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: {0}", e);
            }
        }
Пример #7
0
        public override void OnNavigatedTo(INavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);

            _helloService.SayHello();
        }
Пример #8
0
 public ActionResult <string> Get()
 {
     return(helloService.SayHello());
 }
Пример #9
0
 public string Get()
 {
     // 构造函数注入
     return(_hello.SayHello());
 }
Пример #10
0
 public void OnActionExecuted(ActionExecutedContext context)
 {
     Console.WriteLine(_service.SayHello());
 }
Пример #11
0
 public string GetHelloMessage()
 {
     return(_helloService.SayHello());
 }
Пример #12
0
 public void Run()
 {
     _service.SayHello();
 }
 public ActionResult <string> Post(RequestDto input, IHelloService svc)
 => svc.SayHello() + " " + input.Name;
 public void DisplayGreetingMsg()
 {
     //var serviceHello = new HelloService();
     //serviceHello.SayHello();
     _service.SayHello();
 }
Пример #15
0
        public void Execute()
        {
            string message = helloService.SayHello("Peter");

            writer.Write(message);
        }
 public void SayHello()
 {
     EnsureServiceAvailable();
     _service.SayHello();
 }
Пример #17
0
        //[HttpPost]
        //public ActionResult SayHello(HelloModel model)
        //{
        //    return new JsonResult(_service.SayHello());
        //}

        public ActionResult SayHello([FromServices] IHelloService service)
        {
            return(new JsonResult(service.SayHello()));
        }
 public void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log)
 {
     log.LogInformation($"OUTPUT: {_helloService.SayHello("Kasun Kodagoda")}");
 }
Пример #19
0
 public void OnGet()
 {
     HelloMessage = _helloService.SayHello("Tyrone");
 }
Пример #20
0
 public void OnActionExecuted(ActionExecutedContext context)
 {
     Console.WriteLine($"{_service.SayHello()} | {_extraText}");
 }
Пример #21
0
 public void Execute(string name)
 {
     outputWriter.Write(helloService.SayHello(name));
 }
Пример #22
0
 public ActionResult <string> Hello([FromBody] Request request, IHelloService service) =>
 $"{service.SayHello()} {request.Name}";
Пример #23
0
 public string SayIt(string name)
 {
     return(_helloService.SayHello(name));
 }
        public string SayHello(string name)
        {
            var result = _decoratee.SayHello(name);

            return($"{result} It is {DateTime.Now.ToLongDateString()}.");
        }
Пример #25
0
        public IActionResult Hello(string name)
        {
            var result = _helloService.SayHello(name);

            return(Ok(result));
        }
Пример #26
0
 private void button1_Click(object sender, EventArgs e)
 {
     label1.Text = _helloService.SayHello("Mathieu");
 }
Пример #27
0
 public Task ExecuteAsync()
 {
     _service.SayHello();
     _logger.LogInformation("HelloJob ok");
     return(Task.CompletedTask);
 }
Пример #28
0
 public override void OnActionExecuted(ActionExecutedContext context)
 {
     Console.WriteLine($"{_service.SayHello()} | {_extraText} | {_testWithObject.Text}");
 }