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;
        }
Example #2
0
 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;
 }
Example #4
0
 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;
        }
Example #7
0
 public Index(
     IMyDependency myDependency,
     IOperationTransient transientOperation,
     IOperationScoped scopedOperation,
     IOperationSingleton singletonOperation,
     IOperationSingletonInstance singletonInstanceOperation)
 {
     _myDependency              = myDependency;
     TransientOperation         = transientOperation;
     ScopedOperation            = scopedOperation;
     SingletonOperation         = singletonOperation;
     SingletonInstanceOperation = singletonInstanceOperation;
 }
Example #8
0
 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;
 }
Example #9
0
 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");
 }
Example #10
0
        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;
        }
Example #11
0
        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();
            }
        }
Example #12
0
        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");
        }
Example #13
0
 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;
 }
Example #14
0
 public MyService(IMyDependency myDependency)
 {
     this.myDependency = myDependency;
 }
Example #15
0
 public MyClass(IMyDependency dependency, MyOtherDependency otherDependency)
 {
     Dependency      = dependency;
     OtherDependency = otherDependency;
 }
Example #16
0
 public void SetUp()
 {
     myDependency = MockRepository.GenerateStub <IMyDependency>();
     service      = new MyService(myDependency);
 }
Example #17
0
 public MyService(IMyDependency myDependency)
 {
     this.myDependency = myDependency;
 }
 public NoNotReally(IMyDependency dependency)
 {
     _myDependency = null;     // instead of dependency. Really?
 }
 public MyClass(IMyDependency dependency, MyOtherDependency otherDependency)
 {
     Dependency = dependency;
     OtherDependency = otherDependency;
 }
Example #20
0
 public Worker(ILogger <Worker> logger, IMyDependency myDependency)
 {
     _logger       = logger;
     _myDependency = myDependency;
 }
 public WindsorContainerTestController(IMyDependency myDependency)
 {
     _myDependency = myDependency;
 }
Example #22
0
 public void SetUp()
 {
     myDependency = MockRepository.GenerateStub<IMyDependency>();
     service = new MyService(myDependency);
 }
Example #23
0
 public MyDependencyController(IMyDependency myDependency)
 {
     _myDependency = myDependency;
 }
Example #24
0
 public MyTestableClass(IMyDependency dependency)
 {
     _dependency = dependency;
 }
Example #25
0
 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;
 }
Example #28
0
 public SampleHttpFunction(IMyDependency dependency)
 {
     this._dependency = dependency;
 }
 public MyFacade WithDependency(IMyDependency dependency)
 {
     this.dep = dependency;
     return(this);
 }
Example #30
0
 public MyType(IMyDependency myDependency)
 {
     this.myDependency = myDependency;
 }
Example #31
0
 public MyConsumer(IMyDependency dependency)
 {
 }
 public HomeController(IMyDependency myDependency)
 {
     _myDependency = myDependency;
 }
Example #33
0
 public StepDefinitions(IMyDependency dependency)
 {
 }
 public MyClass(IMyDependency dependency)
 {
     this.dependency = dependency;
 }