public void TranslateTest() { var db = new AccessNorthwind("C:/Northwind.mdb") { Log = Console.Out }; var command = db.GetCommand(db.Products.OrderBy(o => o.ProductName)); command.Connection.Open(); Console.WriteLine(command.CommandText); var reader = command.ExecuteReader(); var items = db.Translate <P>(reader).ToList(); foreach (var item in items) { Console.WriteLine(item.ProductName + " " + item.ID); } command.Connection.Close(); }
public void Test1() { var db = new AccessNorthwind("C:/Northwind.mdb"); var q = db.Users.Where(o => o.ID < 100); var command = db.GetCommand(q); Console.WriteLine(command.CommandText); command.Connection.Open(); var reader = command.ExecuteReader(); try { var items = db.Translate <T>(reader); foreach (var item in items) { Console.Write(item.ID); } } finally { db.Connection.Close(); } }