Beispiel #1
0
        public void Setup()
        {
            var modelFactory = new ModelFactory<UserModel>(() => new UserModel()); // {OnRestore = model => model.Invalidate()};
            _userRepository = new UserRepository(new RepositoryConfiguration(), modelFactory) { Path = @"c:\temp\yoyyin\users" };
            _userRepository.Purge();

            _userImporter = new UserImporter();
            _sniImporter = new SniImporter();
            //DevelopmentUserRepository = new DevelopmentUserRepository(new UserImporter(), new SniImporter(), UserRepository);
            //QandARepository = new Repository<QandAModel>(new RepositoryConfiguration(), qandAFactory) { Path = @"c:\Temp\yoyyin\Q&A" };

            Console.Out.WriteLine("Revision is now {0}", _userRepository.Revision);
        }
Beispiel #2
0
        public void Setup()
        {
            var modelFactory = new ModelFactory<UserModel>(() => new UserModel()); // {OnRestore = model => model.Invalidate()};
            var qandAFactory = new ModelFactory<QandAModel>(() => new QandAModel());
            UserRepository = new UserRepository(new RepositoryConfiguration(), modelFactory)
                                {Path = @"c:\temp\yoyyin\users"};

            UserRepository.Purge();

            //DevelopmentUserRepository = new DevelopmentUserRepository(new UserImporter(), new SniImporter(), UserRepository);

            QandARepository = new Repository<QandAModel>(new RepositoryConfiguration(), qandAFactory)
                                  {Path = @"c:\Temp\yoyyin\Q&A"};
            //UserRepository.SaveSnapshot();

            //UserRepository.InitializeWithDataFromSql();

            //Add5QuestionsAndAnswersPerUser(users);

            Console.Out.WriteLine("Revision is now {0}", UserRepository.Revision);
            //Console.Out.WriteLine("Model size is {0}", _repo.Query(m => m.Users.Count));
        }