title: How to add date objects to C# lists?
body: <p>Earlier I had posted the question <a href="https://stackoverflow.com/q/15100233/146622">Sorting Date and Time</a>.
  It was answered by <em>mipe34</em>, but I am stuck trying to use the solution inside my code.</p>
  
  <p>Here's that I did so far. I created a class as follows:</p>
  
  <pre><code>public class Meals
  {
      public DateTime Start { get; set; }
      public DateTime End { get; set; }
  }
  </code></pre>
  
  <p>In my main class I have the following method that has date pair values:</p>
  
  <pre><code> IList&lt;DateTime&gt; starts = new List&lt;DateTime&gt;();
              IList&lt;DateTime&gt; ends = new List&lt;DateTime&gt;();
              DateTime breakStart1 = new DateTime(2012, 02, 15, 12, 30, 00);  // 15/02/12 12.30PM
              DateTime breakEnd1 = new DateTime(2012, 02, 15, 13, 30, 00);  // 15/02/12 01.30PM
              DateTime breakStart2 = new DateTime(2012, 02, 15, 11, 00, 00);  // 15/02/12 11.00AM
              DateTime breakEnd2 = new DateTime(2012, 02, 15, 12, 00, 00);  // 15/02/12 12.00PM
              DateTime breakStart3 = new DateTime(2012, 02, 15, 12, 00, 00);  // 15/02/12 12.00PM
              DateTime breakEnd3 = new DateTime(2012, 02, 15, 01, 00, 00);  // 15/02/12 01.00PM
              starts.Add(breakStart1);
              starts.Add(breakStart2);
              starts.Add(breakStart3);
              ends.Add(breakEnd1);
              ends.Add(breakEnd2);
              ends.Add(breakEnd3);
              for (int i = 0; i &lt; starts.Count; i++)
              {
                  var breaks = new List&lt;Break&gt;()
  
  
               {
                   //for (int j= 0; j&lt;starts.Count; j++)
                   //{
                   new Break()
                       {
                           MealStart = starts[i],
                           MealEnd = ends[i]
  
                       }
                  // }
               };
  
                  var ordered = breaks.OrderBy(s =&gt; s.MealStart);
                  foreach (var ord in ordered)
                  {
                      System.Console.WriteLine(ord.MealStart);
                      System.Console.WriteLine(ord.MealEnd);
                  }
              }
  </code></pre>
  
  <p>How can I pass all my date pairs and use his solution? it doesn't bring back the expected value.</p>