Func<>
C# で Lambdaの渡されたパラメーターの値を取得する方法
IEnumerable<AccountSummary> _data = await accountRepo.GetAsync();
string _query = "1011";
Accounts = _data.Filter(p => p.AccountNumber == _query);
これが私の拡張メソッドです
public static ObservableCollection<T> Filter<T>(this IEnumerable<T> collection, Func<T, bool> predicate)
{
string _target = predicate.Target.ToString();
// i want to get the value of query here.. , i expect "1011"
throw new NotImplementedException();
}
_targetに割り当てられた Filter 拡張メソッド内のqueryの値を取得したい