1 public class DBSessionFactory:IDAL.IDBSessionFactory
2 {
3 /// <summary>
4 /// 此方法的作用: 提高效率,在线程中 共用一个 DBSession 对象!
5 /// </summary>
6 /// <returns></returns>
7 public IDAL.IDBSession GetDBSession()
8 {
9 //从当前线程中 获取 DBContext 数据仓储 对象
10 //CallContext.GetData 这个函数还不太懂
11 IDAL.IDBSession dbSesion = CallContext.GetData(typeof(DBSessionFactory).Name) as DBSession;
12 if (dbSesion == null)
13 {
14 dbSesion = new DBSession();
15 CallContext.SetData(typeof(DBSessionFactory).Name, dbSesion);
16 }
17 return dbSesion;
18 }
19 }
请问11行是什么意思 以前还没用过
CallContext.GetData