public void CanCopyTableWithTransformFromConnectionStringSettings()
        {
            using (UsersToPeopleFromConnectionStringSettings process = new UsersToPeopleFromConnectionStringSettings())
                process.Execute();

            System.Collections.Generic.List<string[]> names = Use.Transaction<System.Collections.Generic.List<string[]>>("test", delegate(IDbCommand cmd)
            {
                System.Collections.Generic.List<string[]> tuples = new System.Collections.Generic.List<string[]>();
                cmd.CommandText = "SELECT firstname, lastname from people order by userid";
                using (IDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        tuples.Add(new string[] { reader.GetString(0), reader.GetString(1) });
                    }
                }
                return tuples;
            });
            AssertNames(names);
        }
        public void CanCopyTableWithTransformFromConnectionStringSettings()
        {
            using (UsersToPeopleFromConnectionStringSettings process = new UsersToPeopleFromConnectionStringSettings())
                process.Execute();

            System.Collections.Generic.List <string[]> names = Use.Transaction <System.Collections.Generic.List <string[]> >("test", delegate(IDbCommand cmd)
            {
                System.Collections.Generic.List <string[]> tuples = new System.Collections.Generic.List <string[]>();
                cmd.CommandText = "SELECT firstname, lastname from people order by userid";
                using (IDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        tuples.Add(new string[] { reader.GetString(0), reader.GetString(1) });
                    }
                }
                return(tuples);
            });
            AssertNames(names);
        }
예제 #3
0
        public async Task CanCopyTableWithTransformFromConnectionStringSettings()
        {
            await SetupTables();

            using (UsersToPeopleFromConnectionStringSettings process = new UsersToPeopleFromConnectionStringSettings())
                await process.Execute();

            System.Collections.Generic.List <string[]> names = await Database.Transaction("test", async delegate(DbCommand cmd)
            {
                System.Collections.Generic.List <string[]> tuples = new System.Collections.Generic.List <string[]>();
                cmd.CommandText = "SELECT firstname, lastname from people order by userid";
                using (DbDataReader reader = await cmd.ExecuteReaderAsync())
                {
                    while (await reader.ReadAsync())
                    {
                        tuples.Add(new string[] { reader.GetString(0), reader.GetString(1) });
                    }
                }
                return(tuples);
            });

            AssertNames(names);
        }