Exemple #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
     }));
 }
Exemple #2
0
 public Task Invoke(HttpContext httpContext)
 {
     return(httpContext.Response.WriteAsync("In Middleware: " + _foo.GetFoo()));
     //return _next(httpContext);
 }
Exemple #3
0
 public string GetMessage()
 {
     return(_foo.GetFoo() + _bar.GetBar());
 }
Exemple #4
0
 public string GetMessage() => _foo.GetFoo() + _bar.GetBar();
Exemple #5
0
 public DiClass1(IThing <Class1> _thing, IFoo foo)
 {
     Console.WriteLine($"DIed {_thing.GetName}");
     Console.WriteLine($"{foo.GetFoo()}");
 }
Exemple #6
0
 public Class1(IFoo foo)
 {
     Console.WriteLine(foo.GetFoo());
 }