public void Initialize()
 {
     _repository = new MemorySettingRepository(new LongPrimaryKeyGenerator());
     _settingManager = new SettingManager(new SampleSettingDefinitionManager())
                       {
                           Session = new AbpSession(),
                           SettingStore = new SettingStore(_repository)
                       };
     FillTestData(_repository);
 }
Example #2
0
        static SettingContext Create()
        {
            // AppSettingRepository
            MemorySettingRepository appSettingRepository = new MemorySettingRepository();
            appSettingRepository.Add("Argument05", "XXXXXXXXXXXXX");
            appSettingRepository.Add("Argument06", "YYYYYYYYYYYYY");
            appSettingRepository.Add("Argument07", "ZZZZZZZZZZZZZ");

            // ConnectionStringRepository
            MemorySettingRepository connectionStringRepository = new MemorySettingRepository();
            connectionStringRepository.Add("Database04", "Data Source=192.168.4.4;Initial Catalog=DB04;");
            connectionStringRepository.Add("Database05", "Data Source=192.168.5.5;Initial Catalog=DB05;");

            // SettingContext
            SettingContext settingContext = new MemorySettingContext(appSettingRepository, connectionStringRepository);

            // Return
            return settingContext;
        }
        private static void FillTestData(MemorySettingRepository repository)
        {
            //Language setting for application
            repository.Insert(
                new Setting
                {
                    UserId = null,
                    Name = "Language",
                    Value = "fr"
                });

            //Language setting for UserId = 1
            repository.Insert(
                new Setting
                {
                    UserId = 1,
                    Name = "Language",
                    Value = "tr"
                });
        }
 public void Initialize()
 {
     _repository = new MemorySettingRepository(new LongPrimaryKeyGenerator());
     _settingManager = new SettingManager(_repository, new SampleSettingDefinitionManager());
     FillTestData(_repository);
 }