我想寫一個發現是長於4個字符,並打印出來的所有用戶名對我的數據庫查詢,我的代碼有云:查詢安慰
也 我需要去改變它到列表/數組的某種返回類型?
public string[] FindNameByLength(int minimumCharNumber)
{
var query = from u in db.Users
where u.FullName.Length > minimumCharNumber
select u.FullName;
string[] namesLength;
int counter;
foreach (var s in query)
{
namesLength.Concat(new[] {s });
}
return namesLength;
}
我怎麼可以將每個名稱添加到數組中?