public BaseController(IHttpContextAccessor httpContext, ITenantDbFactory dbFactory)
        {
            Tenant = httpContext.HttpContext.GetTenant();

            if (Tenant != null)
            {
                Context = dbFactory.GetTenantDatabase(Tenant.DbName);
            }
        }
예제 #2
0
        public virtual void Persist(string TenantAccountId, ITenantDbFactory dbconf, bool IsNew)
        {
            if (IsNew)
            {
                string        sql        = "INSERT INTO eb_connections (con_type, solution_id, nick_name, con_obj) VALUES (@con_type, @solution_id, @nick_name, @con_obj) RETURNING id";
                DbParameter[] parameters = { dbconf.DataDB.GetNewParameter("con_type",    System.Data.DbType.String,     EbConnectionType),
                                             dbconf.DataDB.GetNewParameter("solution_id", System.Data.DbType.String,     TenantAccountId),
                                             dbconf.DataDB.GetNewParameter("nick_name",   System.Data.DbType.String,     !(string.IsNullOrEmpty(NickName))?NickName:string.Empty),
                                             dbconf.DataDB.GetNewParameter("con_obj",     NpgsqlTypes.NpgsqlDbType.Json, EbSerializers.Json_Serialize(this)) };
                var           iCount = dbconf.DataDB.DoQuery(sql, parameters);
            }

            else if (!IsNew)
            {
                string        sql        = @"UPDATE eb_connections SET eb_del = true WHERE con_type = @con_type AND solution_id = @solution_id; 
                                      INSERT INTO eb_connections (con_type, solution_id, nick_name, con_obj) VALUES (@con_type, @solution_id, @nick_name, @con_obj)";
                DbParameter[] parameters = { dbconf.DataDB.GetNewParameter("con_type",    System.Data.DbType.String,     EbConnectionType),
                                             dbconf.DataDB.GetNewParameter("solution_id", System.Data.DbType.String,     TenantAccountId),
                                             dbconf.DataDB.GetNewParameter("nick_name",   System.Data.DbType.String,     !(string.IsNullOrEmpty(NickName))?NickName:string.Empty),
                                             dbconf.DataDB.GetNewParameter("con_obj",     NpgsqlTypes.NpgsqlDbType.Json, EbSerializers.Json_Serialize(this)) };
                var           iCount = dbconf.DataDB.DoNonQuery(sql, parameters);
            }
        }
예제 #3
0
 public EbBaseService(ITenantDbFactory _dbf)
 {
     this.TenantDbFactory = _dbf as TenantDbFactory;
 }
예제 #4
0
 public MenuServices(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #5
0
 public MultiLanguageService(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #6
0
 public TenantRepository(ITenantDbFactory tenantDbFactory)
 {
     TenantDbFactory = tenantDbFactory;
 }
예제 #7
0
 public TenantController(IHttpContextAccessor httpContext, ITenantDbFactory dbFactory) : base(httpContext, dbFactory)
 {
 }
예제 #8
0
 public DataVisService(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #9
0
 public DevRelatedServices(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #10
0
 public UnitOfWork(IUserDbFactory userDbFactory, ITenantDbFactory tenantDbFactory)
 {
     _userDbFactory   = userDbFactory;
     _tenantDbFactory = tenantDbFactory;
 }
예제 #11
0
 public DataSourceService(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #12
0
 public ChatbotServices(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #13
0
 public EbObjectService(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #14
0
 public FileService(ITenantDbFactory _tdb, IMessageProducer _mqp, IMessageQueueClient _mqc) : base(_tdb, _mqp, _mqc)
 {
 }
예제 #15
0
 public EbBaseService(ITenantDbFactory _dbf, IMessageProducer _mqp)
 {
     this.TenantDbFactory  = _dbf as TenantDbFactory;
     this.MessageProducer3 = _mqp as RabbitMqProducer;
 }
예제 #16
0
 public EbBaseService(ITenantDbFactory _dbf, IMessageProducer _mqp, IMessageQueueClient _mqc)
 {
     this.TenantDbFactory    = _dbf as TenantDbFactory;
     this.MessageProducer3   = _mqp as RabbitMqProducer;
     this.MessageQueueClient = _mqc as RabbitMqQueueClient;
 }
 public ConnectionManager(ITenantDbFactory _dbf, IMessageProducer _mqp, IMessageQueueClient _mqc) : base(_dbf, _mqp, _mqc)
 {
 }
예제 #18
0
 public TenantUserServices(ITenantDbFactory _dbf) : base(_dbf)
 {
 }
예제 #19
0
 public GoogleMapServices(ITenantDbFactory _dbf) : base(_dbf)
 {
 }