我有一個像集合添加到一個視圖模型列表
public class MemberCommunicationType
{
public long person_id { get; set; }
public int comm_id { get; set; }
public someclass cls{ get; set; }
}
public class GetMemberColl
{
public MemberCommunicationType[] memberCommunication{ get; set; }
}
視圖模型和我有一樣
var query = from p in data.GetMember
where (p.Client == client && p.Person_id == pid)
select p;
查詢數據庫這個查詢返回兩個字段:long person_id
,int comm_id
這是除了視圖模型還有一個字段外,視圖模型中也是如此:someclass cls
如何將查詢返回的結果添加到我的視圖模式L·
輸出應該是一個列表,其中包含memberCommunication的集合以及每個memberCommunication集合的一個空值cls集合。
That works !! - 謝謝! – Gokul 2011-05-26 16:47:31