我需要實體類傳遞到另一個類有一個方法,這是第二類如何傳遞類實體作爲參數?
public void AutoComplet(TextEdit text_searche, Class entity here)
{
AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
ArrayList fo = new ArrayList();
fo = t.pms_product_ALLSelectlabo();
foreach (Class entity here pr in fo)
{
collection.Add(pr.blabla);
}
text_searche.AutoCompleteSource = AutoCompleteSource.CustomSource;
text_searche.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
text_searche.AutoCompleteCustomSource = collection;
}
,並在第一類,我需要做的是
optionDb.AutoComplet(searche, Class entity here);
我怎麼能這樣做?
你問如何傳遞_type_?什麼'pms_product_ALLSelectlabo'返回?是不是單一類型的集合? –