Пример #1
0
        private List <string> GetEnabledDisabledIndexNames(ITableInfo tableInfo, bool isEnabled)
        {
            var indexNamesTemplate = new GetIndexes(tableInfo.DbName, tableInfo.SchemaName, tableInfo.TableName, isEnabled);
            var indexNamesQuery    = indexNamesTemplate.TransformText();

            Console.WriteLine(indexNamesQuery);
            DataTable indexNamesTable;

            try
            {
                indexNamesTable = _queryHelper.ExecuteQueryWithoutParams(tableInfo.DbConnectionString, indexNamesQuery);
            }
            catch (Exception ex)
            {
                throw new IndexServiceException("An error happened while trying to get index names.", ex);
            }

            var columnNames = new List <string>();

            foreach (var rowObject in indexNamesTable.Rows)
            {
                var row = (DataRow)rowObject;
                columnNames.Add((string)row[0]);
            }

            return(columnNames);
        }
Пример #2
0
 public async void GetIndex()
 {
     await Task.Run(() =>
     {
         var gi          = new GetIndexes();
         APIhelper.Flipd = gi.GetIndex();
         RaisePropertyChanged("GetIndex");
     });
 }