Esempio n. 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();

            // Enable middleware to serve generated Swagger as a JSON endpoint.
            app.UseSwagger();

            // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
            // specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "Redbet API V1");
            });

            app.UseMvc();

            InMemoryBus.DIContainerAccessor = () => httpContextAccessor.HttpContext.RequestServices;
        }
Esempio n. 2
0
 public TemplateController(NHibernate.ISession session, ILoggerFactory loggerFactory, IHttpContextAccessor contextAccessor, IHostingEnvironment hostingEnvironment)
 {
     _logger              = loggerFactory.CreateLogger <TemplateController>();
     _session             = session;
     _httpContextAccessor = contextAccessor;
     _hostingEnvironment  = hostingEnvironment;
 }
 public LookupController
 (
     ISession session,
     ILookupApplicationService lookupApplicationService,
     Http.IHttpContextAccessor httpContextAccessor
 ) : base(httpContextAccessor, session, lookupApplicationService)
 {
 }
 public ApplicationController
 (
     IApplicationService applicationService,
     ISession session,
     Http.IHttpContextAccessor httpContextAccessor
 ) : base(httpContextAccessor, session, applicationService)
 {
 }
        protected ControllerBase(Http.IHttpContextAccessor httpContextAccessor, ISession session, params ISessionAware[] sessionAwareDependencies)
        {
            HttpContextAccessor = httpContextAccessor;
            CurrentSession      = session;
            SetSessionUser();

            sessionAwareDependencies.Each(sad => sad.Enlist(session));
            SetServiceProperties(sessionAwareDependencies);
        }
Esempio n. 6
0
        void IStartup.Configure(IApplicationBuilder app)
        {
            this.m_Application = app;

            Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = app.ApplicationServices.
                                                                        GetRequiredService <Microsoft.Extensions.Logging.ILoggerFactory>();

            Microsoft.AspNetCore.Hosting.IHostingEnvironment env = app.ApplicationServices.
                                                                   GetRequiredService <Microsoft.AspNetCore.Hosting.IHostingEnvironment>();

            Microsoft.AspNetCore.Http.IHttpContextAccessor httpContext = app.ApplicationServices.
                                                                         GetRequiredService <Microsoft.AspNetCore.Http.IHttpContextAccessor>();

            this.Configure(app, env);
        }
        public static ISession GetCurrentSession(Web.IHttpContextAccessor context)
        {
            ISessionStorageContainer sessionStorageContainer =
                SessionStorageFactory.GetStorageContainer(context);

            ISession currentSession = sessionStorageContainer.GetCurrentSession();

            if (currentSession == null)
            {
                currentSession = GetNewSession();
                sessionStorageContainer.Store(currentSession);
            }

            return(currentSession);
        }
Esempio n. 8
0
        public FinansijeController(NHibernate.ISession session, ILoggerFactory loggerFactory, Microsoft.AspNetCore.Http.IHttpContextAccessor contextAccessor, IStringLocalizerFactory factory)
        {
            _logger              = loggerFactory.CreateLogger <PonudaController>();
            _session             = session;
            _httpContextAccessor = contextAccessor;

            var korisnik = _session.QueryOver <Korisnik>()
                           .Where(x => x.KorisnickoIme == contextAccessor.HttpContext.User.Identity.Name)
                           .SingleOrDefault <Korisnik>();

            var type         = typeof(Prevod);
            var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);

            _localizer = factory.Create("Prevod" + korisnik.Lang, assemblyName.Name);
        }
Esempio n. 9
0
        private void InitializeTokenAcquisitionObjects()
        {
            IOptions <MicrosoftIdentityOptions>             microsoftIdentityOptions = _provider.GetService <IOptions <MicrosoftIdentityOptions> >();
            IOptions <MsalMemoryTokenCacheOptions>          tokenOptions             = _provider.GetService <IOptions <MsalMemoryTokenCacheOptions> >();
            IOptions <ConfidentialClientApplicationOptions> ccOptions = _provider.GetService <IOptions <ConfidentialClientApplicationOptions> >();
            ILogger <TokenAcquisition> logger            = _provider.GetService <ILogger <TokenAcquisition> >();
            IHttpClientFactory         httpClientFactory = _provider.GetService <IHttpClientFactory>();

            IHttpContextAccessor httpContextAccessor = CreateMockHttpContextAccessor();

            _msalTestTokenCacheProvider = new MsalTestTokenCacheProvider(
                _provider.GetService <IMemoryCache>(),
                tokenOptions);

            _tokenAcquisition = new TokenAcquisition(
                _msalTestTokenCacheProvider,
                httpContextAccessor,
                microsoftIdentityOptions,
                ccOptions,
                httpClientFactory,
                logger);
        }
Esempio n. 10
0
 public IzvestajController(NHibernate.ISession session, ILoggerFactory loggerFactory, Microsoft.AspNetCore.Http.IHttpContextAccessor contextAccessor)
 {
     _logger              = loggerFactory.CreateLogger <IzvestajController>();
     _session             = session;
     _httpContextAccessor = contextAccessor;
 }
Esempio n. 11
0
 public static void Configure(Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor)
 {
     m_httpContextAccessor = httpContextAccessor;
 }
 public HttpSessionContainer(Web.IHttpContextAccessor context)
 {
     this._context = context;
 }
 public ImportCSVController(IWebHostEnvironment environment, IRepository repository, ILogger <ImportCSVController> logger, Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor)
 {
     _environment = environment;
     _repository  = repository;
     _logger      = logger;
     _user        = httpContextAccessor.HttpContext.User.FindFirst(System.Security.Claims.ClaimTypes.Name).Value;
 }
Esempio n. 14
0
 /// <summary>
 /// 생성자
 /// </summary>
 /// <param name="_acc"></param>
 public IPController(Microsoft.AspNetCore.Http.IHttpContextAccessor _acc)
 {
     HttpContextAccessor = _acc;
 }
Esempio n. 15
0
 internal static void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor)
 {
     m_httpContextAccessor = httpContextAccessor;
     ApplicationBuilder    = app;
 }
Esempio n. 16
0
 public CallingMicroservices(HttpClient client, Microsoft.AspNetCore.Http.IHttpContextAccessor _httpContextAccessor, IConfiguration configuration)
 {
     this.client = client;
     this._httpContextAccessor = _httpContextAccessor;
     this._configuration       = configuration;
 }
 public static void Configure(Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor, Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment)
 {
     m_httpContextAccessor = httpContextAccessor;
     _hostingEnvironment   = hostingEnvironment;
 }
 public CustomerRepository(IUnitOfWork uow, Web.IHttpContextAccessor context)
     : base(uow, context)
 {
 }
Esempio n. 19
0
 protected BedrockMvcController(Http.IHttpContextAccessor httpContextAccessor, ISession session, params ISessionAware[] sessionAwareDependencies) : base(httpContextAccessor, session, sessionAwareDependencies)
 {
 }
Esempio n. 20
0
 public DeliveryOptionRepository(IUnitOfWork uow, Web.IHttpContextAccessor context)
     : base(uow, context)
 {
 }
Esempio n. 21
0
 public IndexModel(MTGCardData cardData, Microsoft.AspNetCore.Http.IHttpContextAccessor httpContext)
 {
     this.cardData    = cardData;
     this.httpContext = httpContext.HttpContext;
 }
Esempio n. 22
0
 public AssignmentData(Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor)
 {
     _httpContextAccessor = httpContextAccessor;
     Models.LoadModels();
     Assignments.LoadAssignments();
 }
Esempio n. 23
0
 public NHUnitOfWork(Web.IHttpContextAccessor context)
 {
     this._context = context;
 }
Esempio n. 24
0
 public ProductTitleRepository(IUnitOfWork uow, Web.IHttpContextAccessor context)
     : base(uow, context)
 {
 }
Esempio n. 25
0
 public Repository(IUnitOfWork uow, Web.IHttpContextAccessor context)
 {
     this._uow     = uow;
     this._context = context;
 }
Esempio n. 26
0
 public BasketRepository(IUnitOfWork uow, Web.IHttpContextAccessor context)
     : base(uow, context)
 {
 }
Esempio n. 27
0
 public HomeController(ILogger <HomeController> logger, Microsoft.AspNetCore.Http.IHttpContextAccessor accessor)
 {
     _logger  = logger;
     _session = accessor.HttpContext.Session;
 }