Пример #1
0
        public static SettingsViewModel GetSettings(this TempDataDictionary tempData)
        {
            if (tempData.ContainsKey(SettingsKey))
            {
                return(tempData.Peek(SettingsKey) as SettingsViewModel);
            }

            var configurationProvider = new ConfigurationProvider();
            var settingsViewModel     = new SettingsViewModel {
                NsgaConfiguration = configurationProvider.GetConfiguration()
            };

            tempData.SaveSettings(settingsViewModel);
            return(tempData.Peek(SettingsKey) as SettingsViewModel);
        }