public async Task ExecuteTablePrimitiveAnonymousAsync_Test() { using (var cmd = new DatabaseCommand(_connection)) { cmd.Log = Console.WriteLine; cmd.CommandText = "SELECT EName FROM EMP"; var data = await cmd.ExecuteTableAsync(default(string)); Assert.AreEqual(14, data.Count()); } }
public async Task ExecuteTableDynamicAsync_Test() { using (var cmd = new DatabaseCommand(_connection)) { cmd.Log = Console.WriteLine; cmd.CommandText = "SELECT * FROM EMP"; var data = await cmd.ExecuteTableAsync <dynamic>(); Assert.AreEqual(14, data.Count()); } }
public async Task ExecuteTableFunctionAsync_Test() { using (var cmd = new DatabaseCommand(_connection)) { cmd.Log = Console.WriteLine; cmd.CommandText = "SELECT Empno FROM EMP"; var data = await cmd.ExecuteTableAsync(row => { return(new { Empno = row.Field <int>("Empno") }); }); Assert.AreEqual(14, data.Count()); } }