コード例 #1
0
 private void AddSteps(Pipeline pipeline)
 {
     const string sql = @"
     SELECT IsSuccessful, StepName, Created
     FROM BuildStep
     WHERE PipelineId = @PipelineId
     ORDER BY Created ASC";
     var param = new {pipeline.PipelineId};
     IEnumerable<BuildStep> steps = _connection.Query<BuildStep>(sql, param);
     foreach (BuildStep step in steps)
         pipeline.AddStep(step);
 }
コード例 #2
0
 private void AddSteps(Pipeline pipeline)
 {
     const string CommandText =
         @"
     SELECT IsSuccessful, StepName, Created
     FROM BuildStep
     WHERE PipelineId = @PipelineId
     ORDER BY Created ASC";
     using (DbCommand command = CreateCommand())
     {
         AddParameter(command, "PipelineId", pipeline.Id);
         command.CommandText = CommandText;
         using (DbDataReader reader = GetReader(command))
         {
             while (reader.Read())
             {
                 pipeline.AddStep(new BuildStep(
                                      (bool)reader["IsSuccessful"],
                                      (string)reader["StepName"],
                                      (DateTime)reader["Created"]));
             }
         }
     }
 }