// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IGreetingService greetingService) { loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseFileServer(); app.UseNodeModules(env); //app.UseDefaultFiles(); //app.UseStaticFiles(); app.UseIdentity(); app.UseMvc(ConfigureRoutes); app.Run(async(context) => { var greeting = greetingService.GetGreeting(); await context.Response.WriteAsync(greeting); }); }
public ActionResult Index( IGreetingService greetingService, string name) { ViewBag.Greeting = greetingService.GetGreeting(name); return View(); }
public Task Invoke(HttpContext ctx, IGreetingService service) { if (ctx.Request.Path.StartsWithSegments(_options.Path)) { return(ctx.Response.WriteAsync(service.GetGreeting())); } else { return(_next(ctx)); } }
// GET: Greeting public ActionResult Index() { ViewData["val"] = _greetingService.MSG; ViewData["msg"] = _greetingService.GetGreeting(); return(View()); }
public IActionResult Get() { database.Save(); return(Ok(greetingService.GetGreeting())); }
// GET: /<controller>/ public IActionResult Index() { ViewData["message"] = _greetingService.GetGreeting() + " " + _secondService.GetGreeting(); return(View()); }
public ActionResult Index() { return(Content(_greetingService.GetGreeting())); }
public async Task <IActionResult> GetIndex([FromQuery] GreetingRequest req) { var greeting = await _greetingService.GetGreeting(req); return(Content(greeting.Message)); }