Beispiel #1
0
        public async Task <IEnumerable <FullTextIndex> > SelectIndexesAsync()
        {
            IList <FullTextIndex> output = null;

            using (var context = _dbContext)
            {
                output = await context.ExecuteReaderAsync(
                    CommandType.Text,
                    BySql,
                    async reader =>
                {
                    if ((reader != null) && (reader.HasRows))
                    {
                        output = new List <FullTextIndex>();
                        while (await reader.ReadAsync())
                        {
                            var index = new FullTextIndex();
                            index.PopulateModel(reader);
                            output.Add(index);
                        }
                    }

                    return(output);
                });

                // Remove table prefix from table names
                if (output != null)
                {
                    foreach (var index in output)
                    {
                        index.TableName = index.TableName.Replace(context.Configuration.TablePrefix, "");
                    }
                }
            }

            return(output);
        }