0
partial void Query1_PreprocessQuery(string Filter1, ref IQueryable<Type> query)
{
//how can I loop through the query and add data to a custom list
}
partial void Query1_PreprocessQuery(string Filter1, ref IQueryable<Type> query)
{
//how can I loop through the query and add data to a custom list
}
一般來說,_PreprocessQuery方法是用於限定查詢的內容和沒有做與任何內容(這將是後處理)。因此,一個簡單的方法可能是:
partial void Query1_PreprocessQuery(string Filter1, ref IQueryable<Type> query)
{
query = query.Where(x => x.FilterColumn == Filter1);
}
這是在服務器端,所以即使你沒有攔截的結果發生,我認爲這將是棘手的創建回客戶端的任何名單。
將查詢結果傳遞到客戶端屏幕後,您可以循環查詢並使用其中的內容,例如使用像Query1_Loaded這樣的Screen Property方法或Query1_Changed之類的集合方法,具體取決於您的操作試圖實現。未經測試的代碼,但類似這樣的:
partial void Query1_Loaded(bool succeeded)
{
// Loop through the rows on the screen ...
foreach (IEntityObject rowData in this.Query1)
{
// Reference individual values like this ...
string FilterResult = rowData.Details.Properties["FilterColumn"].Value.ToString()
}
}
}