即時通訊開始MVC &想你關於倉庫&查看模型的建議,特別是幾臺庫數據組合成一個VM。合併視圖模型
如果我有需要自己的存儲庫(對不起,本作的基本性質)三個不同的部分(列)網頁:
UserInfoData - 顯示在左山坳
DiaryData - 所示山坳中間
CommentData - 在右側山坳所示
Im做以下幾點: -
public ActionResult Index(int id)
{
UserInfoData uid = repository.GetUserInfoData(id);
UserInfoDataVM UserViewModel = Mapper.Map<UserInfoData, UserInfoDataVM>(uid);
//RETRIEVE DiaryData & CommentData using same principle as above
return ??
}
我將如何結合這三個虛擬機的到的東西我能回到觀點 - 我用另一個虛擬機,它接受這三個虛擬機的?
是否有與具有自己的數據網頁的小部分打交道時,最好的做法?
感謝湯米,也有很大幫助,Html.RenderAction看起來很有希望與jQuery的看起來也不錯,我去有一個思考在設計網站,並與這兩種技術很好的發揮。 – LenPopLilly 2012-03-03 17:45:30