コード例 #1
0
 public SubObjectOne(IFirstService firstService)
 {
     if (firstService == null)
     {
         throw new ArgumentNullException(nameof(firstService));
     }
 }
コード例 #2
0
 public SubObjectOne(IFirstService firstService)
 {
     if (firstService == null)
     {
         throw new ArgumentNullException("firstService");
     }
 }
コード例 #3
0
 public FirstViewModel(First first, IFirstService firstService)
 {
     Argument.IsNotNull(() => first);
     Argument.IsNotNull(() => firstService);
     _firstService = firstService;
     First = first;
     WriteFirst = new Command(OnWriteFirstExecute);
 }
コード例 #4
0
 public MultipleParameters(IFirstService firstService, ISecondService secondService, IThirdService thirdService,
                           IFourthService fourthService)
 {
     _firstService  = firstService;
     _secondService = secondService;
     _thirdService  = thirdService;
     _fourthService = fourthService;
 }
コード例 #5
0
ファイル: HomeController.cs プロジェクト: YuraOnyfrak/EcoShop
 public HomeController
 (
     ILogger <HomeController> logger,
     IFirstService firstService
 )
 {
     _logger       = logger;
     _firstService = firstService;
 }
コード例 #6
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger,
                                  IFirstService firstService,
                                  ISecondService secondService,
                                  IThirdService thirdService,
                                  IFifthService fifthService,
                                  ISeventhService seventhService,
                                  IServiceScopeFactory serviceScopeFactory)
 {
     _logger                   = logger;
     this._firstService        = firstService;
     this._thirdService        = thirdService;
     this._fifthService        = fifthService;
     this._secondService       = secondService;
     this._seventhService      = seventhService;
     this._serviceScopeFactory = serviceScopeFactory;
 }
コード例 #7
0
ファイル: Complex.cs プロジェクト: xiaopohou/IocPerformance
        public Complex1(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            System.Threading.Interlocked.Increment(ref counter);
        }
コード例 #8
0
ファイル: Complex.cs プロジェクト: pgatilov/IocPerformance
        public Complex(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            Instances++;
        }
コード例 #9
0
        public Complex2(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            System.Threading.Interlocked.Increment(ref counter);
        }
コード例 #10
0
ファイル: Complex.cs プロジェクト: Vislor/IocPerformance
        public Complex2(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            Instances++;
        }
コード例 #11
0
 public HomeController(IFirstService firstService)
 {
     _firstService = firstService;
 }
コード例 #12
0
 public BooksController(IFirstService FirstService)
 {
     this.FirstService = FirstService;
 }
コード例 #13
0
ファイル: Program.cs プロジェクト: horse-framework/horse-mvc
 public TMid(IFirstService firstService)
 {
     _firstService = firstService;
 }
コード例 #14
0
 public FirstViewModel(IFirstService firstService)
     : this(new First(), firstService)
 {
 }
コード例 #15
0
 public HelloController(IFirstService firstService)
 {
     _iFirstService = firstService;
 }
コード例 #16
0
 public SimpleFirstServiceDecorator(IFirstService firstService)
 {
 }
コード例 #17
0
 public AdvancedFirstServiceDecorator(IFirstService firstService)
 {
 }
コード例 #18
0
 public AdvancedFirstServiceDecorator(IFirstService firstService)
 {
 }
コード例 #19
0
ファイル: Consumer1.cs プロジェクト: KY-Programming/core
 public Consumer1(IFirstService service)
 {
     this.service = service;
 }
コード例 #20
0
 public ComplexFirstServiceDecorator(IFirstService firstService)
 {
 }
コード例 #21
0
 public SimpleFirstServiceDecorator(IFirstService firstService)
 {
 }
コード例 #22
0
 public FacadeService(IFirstService firstService, ISecondService secondService)
 {
     _firstService  = firstService;
     _secondService = secondService;
 }
コード例 #23
0
 public TestWithDependency2(IFirstService service)
 {
 }
コード例 #24
0
 public SampleController(IFirstService firstService)
 {
     _firstService = firstService;
 }
コード例 #25
0
ファイル: CompositionService.cs プロジェクト: milche732/xIoC
 public CompositionService(IFirstService firstService, ISecondService secondService)
 {
 }
コード例 #26
0
 // GET: Default/Details/5
 public ActionResult Details([FromServices] IFirstService FirstService)
 {
     _FirstService = FirstService;
     return(Content(_FirstService.WelcomeEquinox()));
 }
コード例 #27
0
 public SecondService(IFirstService firstService)
 {
     _firstService = firstService;
 }
コード例 #28
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IFirstService FirstService)
        {
            loggerFactory.AddConsole();
            app.UseRewriter(new RewriteOptions()
                            //.AddRedirect("redirect-rule/(.*)", "redirected/$1")
                            //.AddRedirect(@"product/Create/(\d+)", "product/Details?id=$1")
                            .AddRewrite(@"product/Create/(\d+)", "product/Details?id=$1", skipRemainingRules: true)
                            //.AddRewrite(@"^rewrite-rule/(\d+)", "rewritten?var1=$1&var2=$2", skipRemainingRules: false)
                            .Add(new RedirectImageRequests(".png", "/png-images")));
            //.Add(new RedirectImageRequests(".jpg", "/jpg-images")));



            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }


            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Product}/{action=Index}/{id?}");
            });
            //app.Use(async (context, next) =>
            //{
            //    string agent = context.Request.Headers["user-agent"].ToString();

            //    if (!string.IsNullOrEmpty(context.Request.QueryString.Value))
            //    {
            //        context.Response.Headers.Add("X-Frame-Options", "localhost");
            //        //context.Response.Headers.Add("X-Content-Type-Options", configuration["CustomMessage"]);
            //        await context.Response.WriteAsync("Query string is not allowed in Middleware pipeline");
            //        await next.Invoke();
            //    }
            //});

            app.Map("/map1", HandleMapMiddlewareOne);

            app.Map("/map2", HandleMapMiddlewareTwo);

            //app.MapWhen(context => context.Request.QueryString.Value.Equals("DeviceId"), appBuilder =>
            //{
            //    app.Run(async context =>
            //    {
            //        await context.Response.WriteAsync("Response for devices");

            //    });
            //});

            app.MapWhen(context => context.Request.Query.ContainsKey("branch"), HandleBranch);

            //Commented for testing purpose only
            app.UseSecurityMiddleware();

            app.Run(async(context) =>
            {
                //throw new Exception("From Middle ware");
                //string welcomeMsg = Configuration["WelcomeEquinox"];
                string welcomeMsg = FirstService.WelcomeEquinox();
                await context.Response.WriteAsync(welcomeMsg);
                //await context.Response.WriteAsync("welcomeMsg");
            });
        }
コード例 #29
0
 public ServiceController(IFirstService firstService, ISecondService secondService, IHttpClientFactory httpClientFactory)
 {
     _httpClientFactory = httpClientFactory;
 }
コード例 #30
0
 public ComplexFirstServiceDecorator(IFirstService firstService)
 {
 }
コード例 #31
0
 public void SetUp()
 {
     service = new FirstService();
 }