阅读背景:

在调用TryUpdateModel之后,对象从nHibernate会话断开。

来源:互联网 

This works:

如此:

public ActionResult Save(int id, string name)
{
    var profile = _profileRepository.GetById(id);
    profile.Name = name;
    _profileRepository.Save(profile); //this calls SaveOrUpdate()

    //session.Commit() gets called in global.asax on Application_EndRequest()
    //profile.Name is changed in the database
}
public ActionResult Save(in



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: