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; }
public HomeController(IGreetingService GreetingService) { greetingService = GreetingService; }
public AccountController(IGreetingService greetings) { _greetingService = greetings; }
public HomeController(IGreetingService greetings) { _greetingService = greetings; }
public Greetings(IGreetingService greeter) { _greeter = greeter; }
public HelloController(IGreetingService greetingService) { _greetingService = greetingService; }
public GreetingController(IGreetingService greetingService, IGreetingService secondService) { _greetingService = greetingService; _secondService = secondService; }
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; }
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)); }
public BookingsModel(UserManager <TennisBookingsUser> userManager, ICourtBookingService courtBookingService, IGreetingService loginGreetingService) { _userManager = userManager; _courtBookingService = courtBookingService; _loginGreetingService = loginGreetingService; }
public HomeController(IGreetingService greeter) { _greeter = greeter; }
public HomeController(IGreetingService greetingService) { _greetingService = greetingService; }
public HelloController(IGreetingService greetingService) =>
public HomeController(IGreetingService greeting) { _greeting = greeting; }
public Greetings(IGreetingService greeter) { this.greeter = greeter; }