Beispiel #1
0
 public DiProxy(
     IPlacesService placesService
     , SessionOperator sessionOperator
     , IObjectTypesService objectTypesService
     , IObjectsService objectsService
     , ILocalizationService localeService
     , IMapper mapper
     , ILocalizer localizer
     , IAdsService adsService
     , IFilesService filesService
     , ConfigValuesCollection configValues
     , IUserInfoService userInfoService)
 {
     _elements.Add(typeof(IPlacesService), placesService);
     _elements.Add(typeof(SessionOperator), sessionOperator);
     _elements.Add(typeof(IObjectTypesService), objectTypesService);
     _elements.Add(typeof(IObjectsService), objectsService);
     _elements.Add(typeof(ILocalizationService), localeService);
     _elements.Add(typeof(IMapper), mapper);
     _elements.Add(typeof(ILocalizer), localizer);
     _elements.Add(typeof(IAdsService), adsService);
     _elements.Add(typeof(IFilesService), filesService);
     _elements.Add(typeof(ConfigValuesCollection), configValues);
     _elements.Add(typeof(IUserInfoService), userInfoService);
 }
Beispiel #2
0
        public Task Invoke(HttpContext httpContext, ILocalizationService localeService, SessionOperator sessionOperator)
        {
            var context = httpContext as DefaultHttpContext;

            var maybeChosenLocaleId = sessionOperator.ChosenLocaleId_Get(httpContext);

            if (!maybeChosenLocaleId.Success)
            {
                var defaultLocaleId = GetDefaultLocaleId(localeService);
                sessionOperator.ChosenLocaleId_Set(httpContext, defaultLocaleId);
            }

            return(_next(httpContext));
        }