Exemplo n.º 1
0
        public void StatementFactory_BuildSelectStatementTest()
        {
            var expectedStatement = @"select [ID] as Code, [Serial], [NAME] as Name from [STAR_SHIP] where [NAME] = @Name";

            var statement = StatementFactory.Select <StarShip>(Dialect.MSSQL, new { Name = "Millennium Falcon" });

            Assert.AreEqual(expectedStatement, statement);
        }
Exemplo n.º 2
0
        public static IEnumerable <TEntity> List <TEntity>(
            this IDbConnection connection,
            object conditions          = null,
            IDbTransaction transaction = null,
            bool buffered           = true,
            int?commandTimeout      = null,
            CommandType?commandType = null)
        {
            var command = StatementFactory.Select <TEntity>(dialect, conditions);

            return(connection.Query <TEntity>(command, conditions, transaction, buffered, commandTimeout, commandType));
        }