悬赏分:30 浏览:181 次
不知道为什么。
用到了NHibernate,
一般是这么用
public int InsertArticle(Article obj)
{
int artcileid = 0;
session = NHibernateHelper.GetCurrentSession();
ITransaction tx = session.BeginTransaction();
try
{
artcileid = (int)session.Save(obj);
tx.Commit();
// 将tags加入Entity_Tag表
TagDAL.SaveTags(obj.ID, TagEntityType.article, obj.Tags);
return artcileid;
}
catch (HibernateException ex)
{
if (null != tx) tx.Rollback();
throw new ApplicationException(ex.Message);
}
finally
{ NHibernateHelper.CloseSession(); }
}SaveTags的定义:用到了SqlHelper类
|
1个月前 Hunts.C : to 沙加 SqlHelper 中使用的是存储过程。 to 玉开 没有为什么,因为我不知道在他之前之后是什么区别。 我只是现在return 之前 ? 希望大哥们多加提点啊 :( |