ListForm<T>
Windows アプリケーション プロジェクトにフォームがあります。また、そのフォームのようにpredicate
フィールドを定義しましたFunc<Order,bool>
private Func<T,bool> predicate;
、、、...ListForm
などのさまざまなタイプで作成できます。OrderDTO
CustomerDTO
DocumentDTO
public class OrderDTO
{
public string Number {get; set;}
public string CustomerName {get; set;}
public int Weight {get; set;}
}
public class CustomerDTO
{
public int CustomerId {get; set;}
public string CustomerName {get; set;}
}
タイプpredicate
のすべてのプロパティを使用して実行時に動的にビルドする方法はありますか?<T>
"X"
0
ListForm
OrderDTO
predicate
t=>t.Number == "X" && t.CustomerName == "X" && t.Weight == 0;
タイプで作成する場合CustomerDTO
、述語は
t=> t.CustomerId == 0 && t.CustomerName == "X";
動的検索フォームの作成に使用したい。
実際、ユーザーがフィルター条件をデータに定義できるフィルター選択ウィンドウがListForm
あり、このフィルター ウィンドウは、「ISearchable 型に基づく汎用検索フォームの作成」で説明したように動的に作成されます。