Beispiel #1
0
        private static void ApplySettingValue(string identifier, string name, SettingItem item)
        {
            using (SettingsEntities entities = EntityFrameworkHelper.CreateContext <SettingsEntities>(EdmxPath))
            {
                UserSettingData userData = entities.GetUserSettingData(identifier, name);

                if (userData != null)
                {
                    item.ApplyUserValue(userData.Value);
                }
            }
        }
        private void ApplySettingValue(string identifier, string name, SettingItem item)
        {
            using (IUnitOfWork work = ServiceProvider.GetService <IDataContextFactory>().Get().Create())
            {
                SettingData setting = work.For <SettingData>().Query.FirstOrDefault(_ => _.Identifier == identifier && _.Name == name);

                if (setting != null)
                {
                    item.ApplyUserValue(setting.Value);
                }
            }
        }
        private static void ApplySettingValue(string identifier, string name, SettingItem item)
        {
            using (SettingsEntities entities = EntityFrameworkHelper.CreateContext<SettingsEntities>(EdmxPath))
            {
                UserSettingData userData = entities.GetUserSettingData(identifier, name);

                if (userData != null)
                {
                    item.ApplyUserValue(userData.Value);
                }
            }
        }
        private void ApplySettingValue(string identifier, string name, SettingItem item)
        {
            using (IUnitOfWork work = ServiceProvider.GetService<IDataContextFactory>().Get().Create())
            {
                SettingData setting = work.For<SettingData>().Query.FirstOrDefault(_ => _.Identifier == identifier && _.Name == name);

                if (setting != null)
                {
                    item.ApplyUserValue(setting.Value);
                }
            }
        }