即时通讯开始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