示例#1
0
        public static SkyWalkingBuilder AddEntityFrameworkCore(this SkyWalkingBuilder builder, Action <DatabaseProviderBuilder> optionAction)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.Services.AddSingleton <ITracingDiagnosticProcessor, EntityFrameworkCoreDiagnosticProcessor>();
            builder.Services.AddSingleton <IEfCoreSpanFactory, EfCoreSpanFactory>();

            if (optionAction != null)
            {
                var databaseProviderBuilder = new DatabaseProviderBuilder(builder.Services);
                optionAction(databaseProviderBuilder);
            }

            return(builder);
        }
        public static SkyWalkingExtensions AddEntityFrameworkCore(this SkyWalkingExtensions extensions, Action <DatabaseProviderBuilder> optionAction)
        {
            if (extensions == null)
            {
                throw new ArgumentNullException(nameof(extensions));
            }

            extensions.Services.AddSingleton <ITracingDiagnosticProcessor, EntityFrameworkCoreTracingDiagnosticProcessor>();
            extensions.Services.AddSingleton <IEntityFrameworkCoreSegmentContextFactory, EntityFrameworkCoreSegmentContextFactory>();

            if (optionAction != null)
            {
                var databaseProviderBuilder = new DatabaseProviderBuilder(extensions.Services);
                optionAction(databaseProviderBuilder);
            }

            return(extensions);
        }
示例#3
0
 public static DatabaseProviderBuilder AddNpgsql(this DatabaseProviderBuilder builder)
 {
     builder.Services.AddSingleton <IEntityFrameworkCoreSpanMetadataProvider, NpgsqlEntityFrameworkCoreSpanMetadataProvider>();
     return(builder);
 }
示例#4
0
 public static DatabaseProviderBuilder AddSqlite(this DatabaseProviderBuilder builder)
 {
     builder.Services.AddSingleton <IEfCoreSpanMetadataProvider, SqliteEFCoreSpanMetadataProvider>();
     return(builder);
 }
 public static DatabaseProviderBuilder AddPomeloMysql(this DatabaseProviderBuilder builder)
 {
     builder.Services.AddSingleton <IEfCoreSpanMetadataProvider, MySqlEFCoreSpanMetadataProvider>();
     return(builder);
 }