Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
 public NorthWindContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
Ejemplo n.º 3
0
 protected override NorthWindDataContext CreateDbContext(IDbContextConfig cfg)
 {
     return(new NorthWindDataContext(cfg.DefaultConnectionString));
 }
Ejemplo n.º 4
0
 protected override SqlConnection CreateDbContext(IDbContextConfig cfg)
 {
     return(new SqlConnection(cfg.DefaultConnectionString));
 }
Ejemplo n.º 5
0
 public AdoDbContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
 protected LinqToSqlDbContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
Ejemplo n.º 7
0
 protected abstract TContext CreateDbContext(IDbContextConfig cfg);
Ejemplo n.º 8
0
 protected DataContextMgrBase(IDbContextConfig cfg)
 {
     _cfg = cfg;
 }
Ejemplo n.º 9
0
 protected EntityFrameworkDbContextMgr(IDbContextConfig cfg)
     : base(cfg)
 {
 }
Ejemplo n.º 10
0
 /// <summary>构造函数</summary>
 public EFDbContext(IDbContextConfig config, IEventBus eventBus) : base("name=" + config.ConnectionName)
 {
     this.Config   = config;
     this.EventBus = eventBus;
 }