/// <summary>测试连接</summary>
        public void TestConnection(IDbContextConfig config)
        {
            var context = new EFDbContext(config, null);

            context.Database.Initialize(false);
            var connection = context.Database.Connection;

            connection.Open();
            connection.Close();
        }
Beispiel #2
0
 public NorthWindContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
Beispiel #3
0
 protected override NorthWindDataContext CreateDbContext(IDbContextConfig cfg)
 {
     return(new NorthWindDataContext(cfg.DefaultConnectionString));
 }
 protected override SqlConnection CreateDbContext(IDbContextConfig cfg)
 {
     return(new SqlConnection(cfg.DefaultConnectionString));
 }
 public AdoDbContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
 protected LinqToSqlDbContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
 protected abstract TContext CreateDbContext(IDbContextConfig cfg);
 protected DataContextMgrBase(IDbContextConfig cfg)
 {
     _cfg = cfg;
 }
Beispiel #9
0
 protected EntityFrameworkDbContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
Beispiel #10
0
 /// <summary>构造函数</summary>
 public EFDbContext(IDbContextConfig config, IEventBus eventBus) : base("name=" + config.ConnectionName)
 {
     this.Config   = config;
     this.EventBus = eventBus;
 }