我想从接口调用这个函数。
ICollection<Store> GetStores(Func<Store, bool> filter, bool includeCustomers = false);
Run Code Online (Sandbox Code Playgroud)
你会怎么称呼它?它需要一个过滤功能,我不知道如何使用。
var returnStores = IRepository.GetStores(/*what to write here*/);
Run Code Online (Sandbox Code Playgroud)
例如,查找带有 storeID 的商店:
public class Store
{
public int StoreId { get; set; }
public string CountryCode { get; set; }
public ICollection<Customer> Customers { get; set; }
}
Run Code Online (Sandbox Code Playgroud) 我有这个数据框:
x year bucket price
1 2108 2010 7 100000
2 2108 2010 2 95000
3 2108 2010 3 93000
4 2108 2010 14 92000
5 2108 2010 13 91000
6 2108 2010 8 90500
7 2108 2010 10 89000
8 2108 2010 5 88000
9 2108 2010 9 87000
10 2108 2010 11 86000
11 2108 2010 16 85000
12 2108 2010 12 84000
13 2108 2010 1 83000
Run Code Online (Sandbox Code Playgroud)
我是按照价格排列的,但是桶的顺序不对,我想把它们拆下来,变成这样:
x year bucket price
1 2108 2010 7 100000 …Run Code Online (Sandbox Code Playgroud)