예제 #1
0
        public IDbConnection CreateOpenConnection()
        {
            MiniProfiler mp = new MiniProfiler($"{Assembly.GetEntryAssembly()?.GetName()} - DatabaseUpdater", MiniProfiler.DefaultOptions);

            (output ?? (output = new NullOutput())).MiniProfiler = mp;
            var connection = new StackExchange.Profiling.Data.ProfiledDbConnection(CreteConnection(), mp);

            connection.Disposed += (_, __) => { mp.Stop(); };

            using (mp?.Ignore())
            {
                connection.Open();
            }

            return(connection);
        }