コード例 #1
0
 T RunStatementInternal <T>(StatementMap statement, ISession session, QueryParam[] parameters)
 {
     if ((statement.OperationType == MappedStatementType.ExecuteScalar) || (statement.OperationType == MappedStatementType.Query) || (statement.OperationType == MappedStatementType.Insert) || (statement.OperationType == MappedStatementType.Update))
     {
         SqlCommandRunner runner = new SqlCommandRunner();
         var result = runner.Run <T>(session, statement.Body.Trim(), null, parameters);
         return(result);
     }
     throw new GoliathDataException(string.Format("Operation {1} not supported on {0}. Use another Run method.", statement.Name, statement.OperationType));
 }
コード例 #2
0
 int RunNonQueryStatementInternal(StatementMap statement, ISession session, QueryParam[] parameters)
 {
     if (statement.OperationType > MappedStatementType.Update)
     {
         var runner = new SqlCommandRunner();
         var result = runner.RunNonQuery(session, statement.Body.Trim(), parameters);
         return(result);
     }
     else
     {
         throw new GoliathDataException(string.Format("Operation {1} not supported on {0}. Use another Run method.", statement.Name, statement.OperationType));
     }
 }