public HomeController( ILogger <HomeController> logger, IConfiguration config, IOptionsMonitor <MyOptions> optionAccessor, IOptionsMonitor <MyOptionsWithDelegateConfig> optionsAccessorWithDelegateConfig, IOptionsMonitor <MySubOptions> subOptionsAccessor, IOptionsSnapshot <MyOptions> snapshotOptionsAccessor, IOptionsSnapshot <MyOptions> namedOptionsAccessor, IMyDependency myDependency, OperationService operationService, IOperationTransient transientOperation, IOperationScoped scopedOperation, IOperationSingleton singletonOperation, IOperationSingletonInstance instanceOperation) { _logger = logger; _config = config; _options = optionAccessor.CurrentValue; _optionsWithDelegateConfig = optionsAccessorWithDelegateConfig.CurrentValue; _subOptions = subOptionsAccessor.CurrentValue; _snapshotOptions = snapshotOptionsAccessor.Value; _named_options_1 = namedOptionsAccessor.Get("named_options_1"); _named_options_2 = namedOptionsAccessor.Get("named_options_2"); _myDependency = myDependency; OperationService = operationService; TransientOperation = transientOperation; ScopedOperation = scopedOperation; SingletonOperation = singletonOperation; InstanceOperation = instanceOperation; }
public Test26Model(IOptions <PositionOptions> options, IMyDependency myDependency, IOptions <ColorOptions> colorOptions) { _options = options.Value; _color_options = colorOptions.Value; _myDependency = myDependency; }
public WeatherForecastController(ILogger <WeatherForecastController> logger, MyDependency dependency, Operation TransientOperation, Operation ScopedOperation, Operation SingletonOperation) { _logger = logger; _myDependency = dependency; _TransientOperation = TransientOperation; _ScopedOperation = ScopedOperation; _SingletonOperation = SingletonOperation; }
public GenericJsonWebHookHandler(IMyDependency dependency) { if (dependency == null) { throw new ArgumentNullException(nameof(dependency)); } _dependency = dependency; this.Receiver = GenericJsonWebHookReceiver.ReceiverName; }
public async Task InvokeAsync(HttpContext context, IMyDependency myDependency) { await context.Response.WriteAsync(string.Format("otherParams:{0}\r\n", _otherParams)); await context.Response.WriteAsync(string.Format("MyDependency Message:{0}\r\n", myDependency.GetMessage("This is a message").Result)); await context.Response.WriteAsync("MyMiddleware Build In Class!\r\n"); await _next(context);//不调用next,则阻断管道 }
public HomeController(IMyDependency myDependency, ILogger <HomeController> logger, OperationService operationService, IOperationTransient transientOperation, IOperationScoped scopedOperation, IOperationSingleton singletonOperation, IOperationSingletonInstance singletonInstanceOperation) { _myDependency = myDependency; _logger = logger; OperationService = operationService; TransientOperation = transientOperation; ScopedOperation = scopedOperation; SingletonOperation = singletonOperation; SingletonInstanceOperation = singletonInstanceOperation; }
public Index( IMyDependency myDependency, IOperationTransient transientOperation, IOperationScoped scopedOperation, IOperationSingleton singletonOperation, IOperationSingletonInstance singletonInstanceOperation) { _myDependency = myDependency; TransientOperation = transientOperation; ScopedOperation = scopedOperation; SingletonOperation = singletonOperation; SingletonInstanceOperation = singletonInstanceOperation; }
public IndexModel( IMyDependency myDependency, OperationService operationService, IOperationTransient transientOperation, IOperationScoped scopedOperation, IOperationSingleton singletonOperation, IOperationSingletonInstance singletonInstanceOperation) { _myDependency = myDependency; OperationService = operationService; TransientOperation = transientOperation; ScopedOperation = scopedOperation; SingletonOperation = singletonOperation; SingletonInstanceOperation = singletonInstanceOperation; }
public OptionsModel( IMyDependency myDependency, IOptionsMonitor <MyOptions> optionsAccessor, IOptionsMonitor <MyOptionsWithDelegateConfig> optionsAccessorWithDelegateConfig, IOptionsMonitor <MySubOptions> subOptionsAccessor, IOptionsSnapshot <MyOptions> snapshotOptionsAccessor, IOptionsSnapshot <MyOptions> namedOptionsAccessor) { _myDependency = myDependency; _options = optionsAccessor.CurrentValue; _optionsWithDelegateConfig = optionsAccessorWithDelegateConfig.CurrentValue; _subOptions = subOptionsAccessor.CurrentValue; _snapshotOptions = snapshotOptionsAccessor.Value; _named_options_1 = namedOptionsAccessor.Get("named_options_1"); _named_options_2 = namedOptionsAccessor.Get("named_options_2"); }
public Index2Model(IMyDependency myDependency, IEnumerable <IMyDependency> myDependencies, ILogger <Index2Model> logger) { _myDependency = myDependency; _myDependencies = myDependencies; Trace.Assert(myDependency is MyDependency2); var dependencyArray = myDependencies.ToArray(); Trace.Assert(dependencyArray[0] is MyDependency); Trace.Assert(dependencyArray[1] is MyDependency2); _logger = logger; }
public CarsController(ElecCarContext context, IMyDependency myDependency, IConfiguration config) { configuration = config; _myDependency = myDependency; _db = context; myDependency.WriteMessage("shdfghsdgf"); if (context.Cars.Count() == 0) { foreach (var b in DataSource.GetCars()) { context.Cars.Add(b); // context.Manufacturers.Add(b.Manufacturer); } context.SaveChanges(); } }
public TodoController(TodoContext context, IMyDependency myDependency) { _context = context; //EFLogging Extend--1 _context.ConfigureLogging(s => Console.WriteLine(s)); if (_context.TodoItems.Count() == 0) { // Create a new TodoItem if collection is empty, // which means you can't delete all TodoItems. _context.TodoItems.Add(new TodoItem { Name = "Item1" }); _context.SaveChanges(); } _myDependency = myDependency; _myDependency.WriteMessage("Dependency_Injection by Constructure"); }
public IndexModel( IMyDependency myDependency, OperationService operationService, OperationService operationService2, IOperationTransient transientOperation, IOperationScoped scopedOperation, IOperationSingleton singletonOperation, IOperationSingletonInstance singletonInstanceOperation, IFoo foo, IBar bar, IThirdPartyService thirdPartyService ) { _myDependency = myDependency; OperationService = operationService; OperationService2 = operationService2; TransientOperation = transientOperation; ScopedOperation = scopedOperation; SingletonOperation = singletonOperation; SingletonInstanceOperation = singletonInstanceOperation; Foo = foo; Bar = bar; ThirdPartyService = thirdPartyService; }
public MyService(IMyDependency myDependency) { this.myDependency = myDependency; }
public MyClass(IMyDependency dependency, MyOtherDependency otherDependency) { Dependency = dependency; OtherDependency = otherDependency; }
public void SetUp() { myDependency = MockRepository.GenerateStub <IMyDependency>(); service = new MyService(myDependency); }
public NoNotReally(IMyDependency dependency) { _myDependency = null; // instead of dependency. Really? }
public Worker(ILogger <Worker> logger, IMyDependency myDependency) { _logger = logger; _myDependency = myDependency; }
public WindsorContainerTestController(IMyDependency myDependency) { _myDependency = myDependency; }
public void SetUp() { myDependency = MockRepository.GenerateStub<IMyDependency>(); service = new MyService(myDependency); }
public MyDependencyController(IMyDependency myDependency) { _myDependency = myDependency; }
public MyTestableClass(IMyDependency dependency) { _dependency = dependency; }
public HomeController(IMyDependency myDependency) { this._dependency = myDependency; }
public Index2Model(IMyDependency myDependency) { _myDependency = myDependency; }
/// <summary> /// 初始化 /// </summary> /// <param name="myDependency"></param> public SampleController(IMyDependency myDependency) { _myDependency = myDependency; }
public SampleHttpFunction(IMyDependency dependency) { this._dependency = dependency; }
public MyFacade WithDependency(IMyDependency dependency) { this.dep = dependency; return(this); }
public MyType(IMyDependency myDependency) { this.myDependency = myDependency; }
public MyConsumer(IMyDependency dependency) { }
public HomeController(IMyDependency myDependency) { _myDependency = myDependency; }
public StepDefinitions(IMyDependency dependency) { }
public MyClass(IMyDependency dependency) { this.dependency = dependency; }