Example #1
0
 public IActionResult Index([FromServices] IFoo foo)
 {
     ViewBag.AppName      = this._config.AppName;
     ViewBag.FromServices = foo.GetFoo();
     return(View(new Person()
     {
         Name = this._config.AppName
     }));
 }
Example #2
0
 public Task Invoke(HttpContext httpContext)
 {
     return(httpContext.Response.WriteAsync("In Middleware: " + _foo.GetFoo()));
     //return _next(httpContext);
 }
Example #3
0
 public string GetMessage()
 {
     return(_foo.GetFoo() + _bar.GetBar());
 }
Example #4
0
 public string GetMessage() => _foo.GetFoo() + _bar.GetBar();
Example #5
0
 public DiClass1(IThing <Class1> _thing, IFoo foo)
 {
     Console.WriteLine($"DIed {_thing.GetName}");
     Console.WriteLine($"{foo.GetFoo()}");
 }
Example #6
0
 public Class1(IFoo foo)
 {
     Console.WriteLine(foo.GetFoo());
 }