Exemplo n.º 1
0
        private async Task <List <AdminModel> > ReadAllDBAsync(DbDataReader reader)
        {
            var posts = new List <AdminModel>();

            using (reader)
            {
                while (await reader.ReadAsync())
                {
                    var post = new AdminModel(Db)
                    {
                        NomeDB = reader.GetString(0),
                    };
                    posts.Add(post);
                }
            }
            return(posts);
        }
Exemplo n.º 2
0
        private async Task <List <AdminModel> > ReadAllTableAsync(string NomeDB, DbDataReader reader)
        {
            var get = new List <AdminModel>();

            using (reader)
            {
                while (await reader.ReadAsync())
                {
                    var adminModel = new AdminModel(Db)
                    {
                        NomeDB    = NomeDB,
                        NomeTable = reader.GetString(0),
                    };
                    get.Add(adminModel);
                }
            }
            return(get);
        }