本文整理汇总了C#中CustomerRepository.GetByFilter方法的典型用法代码示例。如果您正苦于以下问题:C# CustomerRepository.GetByFilter方法的具体用法?C# CustomerRepository.GetByFilter怎么用?C# CustomerRepository.GetByFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomerRepository
的用法示例。
在下文中一共展示了CustomerRepository.GetByFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetByFilterWithAllSubItems_ReturnsExpected
public void GetByFilterWithAllSubItems_ReturnsExpected()
{
using (CustomerRepository repository = new CustomerRepository())
{
IEnumerable<Customer> customers =
repository.GetByFilter(item => item.FirstName == "John", "CustomerSecure", "Orders.OrderDetails");
Assert.IsNotNull(customers.First());
Assert.IsNotNull(customers.First().CustomerSecure);
Assert.IsNotNull(customers.First().Orders);
Assert.IsNotNull(customers.First().Orders.First());
Assert.IsNotNull(customers.First().Orders.First().OrderDetails);
}
}
开发者ID:Division42LLC,项目名称:Division42.Data.Repository.EntityFramework,代码行数:14,代码来源:EntityFrameworkRepositoryBaseTests.cs
示例2: GetByFilterWithNullWhereClauseArgument_ThrowsExceptions
public void GetByFilterWithNullWhereClauseArgument_ThrowsExceptions()
{
using (CustomerRepository repository = new CustomerRepository())
{
IEnumerable<Customer> customers =
repository.GetByFilter(null);
Assert.Fail("Show have thrown an ArgumentNullException.");
}
}
开发者ID:Division42LLC,项目名称:Division42.Data.Repository.EntityFramework,代码行数:10,代码来源:EntityFrameworkRepositoryBaseTests.cs
示例3: GetByFilterWithNullParamsArgument_ThrowsExceptions
public void GetByFilterWithNullParamsArgument_ThrowsExceptions()
{
using (CustomerRepository repository = new CustomerRepository())
{
IEnumerable<Customer> customers =
repository.GetByFilter(item => item.FirstName == String.Empty, null);
Assert.Fail("Show have thrown an ArgumentNullException.");
}
}
开发者ID:Division42LLC,项目名称:Division42.Data.Repository.EntityFramework,代码行数:10,代码来源:EntityFrameworkRepositoryBaseTests.cs