Beispiel #1
0
        public MultiItemResult <T> RunMultiItemQueryNamed <T>(MultiItemQueryFunc <T> f, string readerName, params object[] parms)
        {
            var sw = StopWatch.Start();

            try
            {
                StatusTextBroker.UpdateStatusText(DatabaseChannel, this, string.Format("{0} start reading.", readerName));

                using (var conn = this.GetOpenConnection())
                    return(new MultiItemResult <T>(f(conn, parms)));
            }
            catch (Exception e)
            {
                return(new MultiItemResult <T>(default(List <T>), e));
            }
            finally
            {
                sw.Stop();
                StatusTextBroker.UpdateStatusText(DatabaseChannel, this, string.Format("{0} finished reading, duration {1}", readerName, sw.Elapsed));
            }
        }
Beispiel #2
0
        public MultiItemResult <T> RunMultiItemQuery <T>(MultiItemQueryFunc <T> f, params object[] parms)
        {
            var rdrName = GetThreadName();

            return(this.RunMultiItemQueryNamed(f, rdrName, parms));
        }