/// <summary> /// Executes the command /// </summary> /// <param name="request">The command request</param> /// <returns>The result of the command</returns> public override SqlQueryResult Execute(SqlRequest request) { using SqlConnection connection = _connectionProvider.GetConnection(request.Options); using SqlCommand command = GetSqlCommand(connection, request); DataTable dataTable = _commandExecutor.Execute(command); return(new SqlQueryResult(dataTable)); }
/// <summary> /// Executes the command /// </summary> /// <param name="request">The command request</param> /// <returns>The result of the command</returns> public StoredProcedureResult Execute(StoredProcedureRequest request) { using SqlConnection connection = _connectionProvider.GetConnection(request.Options); SqlCommand command = GetSqlCommand(request, connection); SqlParameter[] parameters = null; if (request.Parameters != null) { parameters = ToSqlParameters(request.Parameters); command.Parameters.AddRange(parameters); } DataTable dataTable = _commandExecutor.Execute(command); HandleResult(request, parameters); return(new StoredProcedureResult(dataTable, request.Parameters)); }