本文整理汇总了C#中UserRepository.Purge方法的典型用法代码示例。如果您正苦于以下问题:C# UserRepository.Purge方法的具体用法?C# UserRepository.Purge怎么用?C# UserRepository.Purge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserRepository
的用法示例。
在下文中一共展示了UserRepository.Purge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
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);
}
示例2: Setup
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));
}