本文整理汇总了C#中IRepository.All方法的典型用法代码示例。如果您正苦于以下问题:C# IRepository.All方法的具体用法?C# IRepository.All怎么用?C# IRepository.All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRepository
的用法示例。
在下文中一共展示了IRepository.All方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupController
public void SetupController()
{
resultsRows = Builder<AwsEc2Status>.CreateListOfSize(totalRows).Build();
repository = Substitute.For<IRepository<AwsEc2Status>>();
repository.All().Returns(resultsRows.AsQueryable());
RepositorySession.DefaultContainerType = typeof(FakeObjectContext);
controller = new QuartzController(repository);
}
示例2: SetupController
public void SetupController()
{
resultsRows = Builder<NiceLittleForm>.CreateListOfSize(TotalRows).Build();
repository = Substitute.For<IRepository<NiceLittleForm>>();
session = Substitute.For<IRepositorySession>();
repository.All().Returns(resultsRows.AsQueryable());
RepositorySession.DefaultContainerType = typeof(FakeObjectContext);
controller = new NiceLittleFormController(repository, session);
}
示例3: CategoriesController
public CategoriesController(IRepository repository)
: this()
{
_repository = repository;
var catTree = _repository.All<CategoryTree>().FirstOrDefault();
if (catTree != null)
ViewBag.CategoryTree = catTree.Root;
}
示例4: ClearDatabase
private static void ClearDatabase(IRepository<News> repository)
{
foreach (var news in repository.All())
{
repository.Delete(news.Id);
}
repository.SaveChanges();
}
示例5: CanDeleteUser
protected bool CanDeleteUser(User user, IRepository repository)
{
var results = repository.All<MatchResult>().Any(r => r.Player.Id == user.Id);
return !results;
}