Пример #1
0
        public void Initialize()
        {
            var options = new DbContextOptionsBuilder <TodoListContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
            var context = new TodoListContext(options);

            new InMemoryDatabasePopulator(context).PopulateData();

            _provider = new ReaderProvider(context);
        }
Пример #2
0
        private void RefreshReaderUnits()
        {
            cbReaderUnit.Items.Clear();

            if (cbReaderProvider.SelectedIndex > -1)
            {
                string         provider       = cbReaderProvider.SelectedItem.ToString();
                LibraryManager libmgt         = LibraryManager.getInstance();
                ReaderProvider readerProvider = libmgt.getReaderProvider(provider);
                if (readerProvider != null)
                {
                    ReaderUnitCollection readers = readerProvider.getReaderList();
                    foreach (ReaderUnit reader in readers)
                    {
                        cbReaderUnit.Items.Add(reader.getName());
                    }
                }
            }
        }