public override void InitalizeData() { Message = _helloService.SayHello(); base.InitalizeData(); }
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)); }
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 ))); }
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 ))); }
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(); }
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); } }
public override void OnNavigatedTo(INavigationParameters parameters) { base.OnNavigatedTo(parameters); _helloService.SayHello(); }
public ActionResult <string> Get() { return(helloService.SayHello()); }
public string Get() { // 构造函数注入 return(_hello.SayHello()); }
public void OnActionExecuted(ActionExecutedContext context) { Console.WriteLine(_service.SayHello()); }
public string GetHelloMessage() { return(_helloService.SayHello()); }
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(); }
public void Execute() { string message = helloService.SayHello("Peter"); writer.Write(message); }
public void SayHello() { EnsureServiceAvailable(); _service.SayHello(); }
//[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")}"); }
public void OnGet() { HelloMessage = _helloService.SayHello("Tyrone"); }
public void OnActionExecuted(ActionExecutedContext context) { Console.WriteLine($"{_service.SayHello()} | {_extraText}"); }
public void Execute(string name) { outputWriter.Write(helloService.SayHello(name)); }
public ActionResult <string> Hello([FromBody] Request request, IHelloService service) => $"{service.SayHello()} {request.Name}";
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()}."); }
public IActionResult Hello(string name) { var result = _helloService.SayHello(name); return(Ok(result)); }
private void button1_Click(object sender, EventArgs e) { label1.Text = _helloService.SayHello("Mathieu"); }
public Task ExecuteAsync() { _service.SayHello(); _logger.LogInformation("HelloJob ok"); return(Task.CompletedTask); }
public override void OnActionExecuted(ActionExecutedContext context) { Console.WriteLine($"{_service.SayHello()} | {_extraText} | {_testWithObject.Text}"); }