1: namespace Data
2: {
3: /// <summary>
4: /// OA数据库基类
5: /// </summary>
6: public abstract class OARepositoryBase
7: {
8: protected Data.OA.LinqOADataContext _db =
(Data.OA.LinqOADataContext)Data.DataContextFactory.Intance("OA");
9:
10: /// <summary>
11: /// 虚方法,子类可以根据自己的逻辑去复写这个方法
12: /// </summary>
13: public virtual void SubmitChanges()
14: {
15: ChangeSet chs = _db.GetChangeSet();
16: if (chs.Deletes.Count > 0
|| chs.Inserts.Count > 0
|| chs.Updates.Count > 0)
17: _db.SubmitChanges();
18: }
19: }
20:
21:
22: }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)