예제 #1
0
        ///<summary>Perform the given function in the context of the given connectionName db and return a T.</summary>
        public static T GetT <T>(Func <T> fn, ConnectionNames connectionName)
        {
            T ret = default(T);

            ExecuteThread(new ODThread((o) => {
                using (DataConnection dataConn = new DataConnection()) {
                    ConnectionStore.SetDbT(connectionName, dataConn: dataConn);
                    ret = fn();
                }
            }));
            return(ret);
        }
예제 #2
0
 ///<summary>Perform the given function in the context of the given connectionName db and return a T.</summary>
 public static T GetT <T>(Func <T> fn, ConnectionNames connectionName)
 {
     return(GetT(fn, new Action(() => { ConnectionStore.SetDbT(connectionName); })));
 }