title: How can I do parallel processing inside foreach loop for "requestData"?
body: <p>I am iterating one <code>foreach loop</code> in which I am parsing one string like this:</p>
  
  <p>I want to fire parallel request in <code>HttpWebRequest</code> for my string "<code>imageUrl</code>". Means At a time 4 request and response type of system.(For Utility of my Core).</p>
  
  <p>How can I do it?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>foreach (var item in requestData)
  {
  
      try
      {
          string imageUrl = Convert.ToString(item.ImageUrl);
          imageUrl = imageUrl.Replace('\r', ' ');
           //It is Use for saving at our project location.
          string saveLocation = 
                 @AppDomain.CurrentDomain.BaseDirectory + @"Image\someone.jpg";
  
          byte[] imageBytes;
          try
          {
              HttpWebRequest imageRequest = 
                                  (HttpWebRequest)WebRequest.Create(imageUrl);
              WebResponse imageResponse = imageRequest.GetResponse();
              Stream responseStream = imageResponse.GetResponseStream();
              using (BinaryReader br = new BinaryReader(responseStream))
              {
                  imageBytes = br.ReadBytes(500000);
                  br.Close();
              }
              responseStream.Close();
              imageResponse.Close();
  
              FileStream fs = null;
              BinaryWriter bw = null;
              fs = new FileStream(saveLocation, FileMode.Create);
              bw = new BinaryWriter(fs);
              bw.Write(imageBytes);
  
              fs.Close();
              bw.Close();
              id = Convert.ToString(item.Id);
              // string ImageUrl= Convert.ToString(dr["ImageUrl"]);
              ImageProcess(id);
          }
          catch (Exception)
          {
              log.Info("Image Url Wrong!!!");
              drCurrentRow = dt.NewRow();
              drCurrentRow["Id"] = Convert.ToString(item.Id); ;
              drCurrentRow["Label"] = "Error";
              drCurrentRow["Score"] = 0;
              drCurrentRow["Flag"] = "1";
              dt.Rows.Add(drCurrentRow);
              //drCurrentRow = dt.NewRow();
              dt.AcceptChanges();
          }
  
          finally
          {
              fs.Close();
              bw.Close();
          }
      }
      catch (Exception e)
      {
          log.Info(e);
      }              
  
  }
  BulkInsert();
  }
  </code></pre>
  
  <p>I want to fire parallel request in <code>HttpWebRequest</code> for my string <code>imageUrl</code>.</p>
  
  <p>How can I do it?</p>