Esempio n. 1
0
        private async Task <DataWithVersion <SettingsForClient> > GetForClientImpl()
        {
            M.Settings mSettings = await _db.Settings.FirstOrDefaultAsync();

            if (mSettings == null)
            {
                // This should never happen
                throw new BadRequestException("Settings have not been initialized");
            }

            // Prepare the settings for client
            var settings      = _mapper.Map <SettingsForClient>(mSettings);
            var activeCulures = _globalSettingsCache.GetGlobalSettings().Data.ActiveCultures;

            settings.PrimaryLanguageName   = GetCultureDisplayName(settings.PrimaryLanguageId);
            settings.SecondaryLanguageName = GetCultureDisplayName(settings.SecondaryLanguageId);

            // Tag the settings for client with their current version
            var result = new DataWithVersion <SettingsForClient>
            {
                Version = mSettings.SettingsVersion.ToString(),
                Data    = settings
            };

            return(result);
        }
Esempio n. 2
0
 private DataWithVersion <GlobalSettingsForClient> GetForClientImpl()
 {
     return(_globalSettingsCache.GetGlobalSettings());
 }