public ActionResult Index(
     IGreetingService greetingService,
     string name)
 {
     ViewBag.Greeting = greetingService.GetGreeting(name);
     
     return View();
 }
 public GreetingMiddleware(RequestDelegate next,
     IMemoryCache memoryCache,
     ILogger<GreetingMiddleware> logger,
     IGreetingService greetingService)
 {
     _next = next;
     _memoryCache = memoryCache;
     _greetingService = greetingService;
     _logger = logger;
 }
Example #3
0
 public HomeController(IGreetingService GreetingService)
 {
     greetingService = GreetingService;
 }
 public AccountController(IGreetingService greetings)
 {
     _greetingService = greetings;
 }
 public HomeController(IGreetingService greetings)
 {
     _greetingService = greetings;
 }
Example #6
0
 public Greetings(IGreetingService greeter)
 {
     _greeter = greeter;
 }
 public HelloController(IGreetingService greetingService)
 {
     _greetingService = greetingService;
 }
 public GreetingController(IGreetingService greetingService, IGreetingService secondService)
 {
     _greetingService = greetingService;
     _secondService = secondService;
 }
Example #9
0
 public HomeController(IGreetingService service)
 {
     this.service = service;
 }
 //构造函数注入
 public HomeController(IGreetingService greetingService)
 {
     //HomeController不依赖IGreetingService的具体实现
     _greetingService = greetingService ?? throw new ArgumentNullException(nameof(greetingService));
 }
 public GreetingController(IGreetingService greetingService)
 {
     this.greetingService = greetingService;
 }
 public GreetingServiceFilter(IGreetingService greetingService)
 {
     this.greetingService = greetingService;
 }
Example #13
0
 public HelloHandler(IGreetingService service)
 {
     _service = service;
 }
 public LoggingGreetingService(IGreetingService innerService, ILogger logger)
 {
     this.innerService = innerService ?? throw new ArgumentNullException(nameof(innerService));
     this.logger       = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Example #15
0
 public BookingsModel(UserManager <TennisBookingsUser> userManager, ICourtBookingService courtBookingService, IGreetingService loginGreetingService)
 {
     _userManager          = userManager;
     _courtBookingService  = courtBookingService;
     _loginGreetingService = loginGreetingService;
 }
 public HomeController(IGreetingService greeter)
 {
     _greeter = greeter;
 }
Example #17
0
 public HomeController(IGreetingService greetingService)
 {
     _greetingService = greetingService;
 }
 public HelloController(IGreetingService greetingService) =>
 public HomeController(IGreetingService greeting)
 {
     _greeting = greeting;
 }
Example #20
0
 public Greetings(IGreetingService greeter)
 {
     this.greeter = greeter;
 }