コード例 #1
0
 public void Loaded(
     DbConfigurationLoadedEventArgs loadedEventArgs,
     DbConfigurationInterceptionContext interceptionContext)
 {
     Assert.Same(_snapshot, loadedEventArgs.DependencyResolver);
     Assert.NotNull(interceptionContext);
     Called++;
 }
コード例 #2
0
        public void Loaded(DbConfigurationLoadedEventArgs loadedEventArgs, DbConfigurationInterceptionContext interceptionContext)
        {
            var formatterFactory = loadedEventArgs.DependencyResolver
                                   .GetService <Func <DbContext, Action <string>, DatabaseLogFormatter> >();

            var formatter = formatterFactory(null, (s) => { Debug.WriteLine(s); });

            DbInterception.Add(formatter);
        }
コード例 #3
0
ファイル: DatabaseLogger.cs プロジェクト: yao-yi/DNTProfiler
        public void Loaded(DbConfigurationLoadedEventArgs loadedEventArgs,
                           DbConfigurationInterceptionContext interceptionContext)
        {
            var logger = new ExceptionLogger();

            _baseInfoQueue = new InfoQueue <BaseInfo>();
            var profiler = new DbProfiler(_baseInfoQueue)
            {
                AssembliesToExclude = new SortedSet <string>
                {
                    typeof(DbProfiler).Assembly.GetName().Name,
                    typeof(DatabaseLogger).Assembly.GetName().Name
                }
            };

            DbInterception.Add(new DatabaseInterceptor(profiler));
            _commandsTransmitter = new CommandsTransmitter(
                _baseInfoQueue, logger, new SimpleHttp(), _serverUri, LoggerPath.GetLogFileFullPath(_logFilePath));
            _commandsTransmitter.Start();
        }
コード例 #4
0
 public void Loaded(
     DbConfigurationLoadedEventArgs loadedEventArgs,
     DbConfigurationInterceptionContext interceptionContext)
 {
     TestLoadedInterceptor.HooksRun.Push(_tag);
 }
コード例 #5
0
 public void Loaded(
     DbConfigurationLoadedEventArgs loadedEventArgs,
     DbConfigurationInterceptionContext interceptionContext)
 {
     loadedEventArgs.AddDependencyResolver(MutableResolver.Instance, overrideConfigFile: true);
 }
コード例 #6
0
 public void Loaded(System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationLoadedEventArgs loadedEventArgs, DbConfigurationInterceptionContext interceptionContext)
 {
     loadedEventArgs.ReplaceService <DbProviderServices>(
         (s, _) => new EFCachingProviderServices());
 }