コード例 #1
0
        public void LoadTables()
        {
            if (ProviderName.IsNullOrWhiteSpace() || ConnectionString.IsNullOrWhiteSpace())
            {
                throw new Exception($"数据库{Name}配置ProviderName/ConnectionString错误");
            }

            var service = GetDatabaseService(ConnectionString);

            var filterTables = FilterTables.IsNullOrEmpty() ? new List <string>() : FilterTables.Split(new char[] { ',', ',' }).ToList();
            var baseFields   = BaseFields.IsNullOrEmpty() ? new List <string>() : BaseFields.Split(new char[] { ',', ',' }).ToList();
            var tables       = service.GetTableModels(filterTables, baseFields);

            Tables.AddRange(tables);
        }
コード例 #2
0
 void ParseFilter()
 {
     // parse tables to collect
     if (!string.IsNullOrEmpty(FilterTablesIgnore))
     {
         string[] sFilter = FilterTablesIgnore.Split(';');
         FilterTableIgnoreList = new List <string>(sFilter);
     }
     else
     {
         FilterTableIgnoreList = new List <string>();
     }
     // parse tables to ignore
     if (!string.IsNullOrEmpty(FilterTables))
     {
         string[] sFilter = FilterTables.Split(';');
         FilterTableList = new List <string>(sFilter);
     }
     else
     {
         FilterTableList = new List <string>();
     }
     // parse request to collect
     if (!string.IsNullOrEmpty(FilterRequestType))
     {
         string[] sFilter = FilterRequestType.Split(';');
         FilterRequestTypeList = new List <string>(sFilter);
     }
     else
     {
         FilterRequestTypeList = new List <string>();
     }
     // parse request to collect
     if (!string.IsNullOrEmpty(FilterRequestTypeIgnore))
     {
         string[] sFilter = FilterRequestTypeIgnore.Split(';');
         FilterRequestTypeIgnoreList = new List <string>(sFilter);
     }
     else
     {
         FilterRequestTypeIgnoreList = new List <string>();
     }
 }