title: How to remove duplicate values from nested C# list
body: <p>I have a model setup like below:</p>
  
  <pre><code>public class ReportScheduleModel
  {
      public string Day { get; set; }
      public List&lt;ReportTimes&gt; reportTimes { get; set; }
  }
  
  public class ReportTimes
  {
      public byte hourOfDay { get; set; }
      public byte minuteOfDay { get; set; }
      public string reportType { get; set; }
  }
  </code></pre>
  
  <p>I can then pass an entire list back to my controller with the following list format:</p>
  
  <pre><code>List&lt;ReportScheduleModel&gt; ReportSchedule
      [0]-&gt;Day: 'Sunday'
           [ReportTimes]: [0]-&gt;hourOfDay: '09'
                          minuteOfDay: '23'
                          reportType: 'Test1'
                     [1]-&gt;hourOfDay: '08'
                          minuteOfDay: '11'
                          reportType: 'Test2'
      [1]-&gt;Day: 'Sunday'
           [ReportTimes]: [0]-&gt;hourOfDay: '09'
                          minuteOfDay: '23'
                          reportType: 'Test1'
                          [1]-&gt;hourOfDay: '11'
                          minuteOfDay: '30'
                          reportType: 'Test1'
      [2]-&gt;Day: 'Monday'
           [ReportTimes]: [0]-&gt;hourOfDay: '09'
                          minuteOfDay: '23'
                          reportType: 'Test1'
  </code></pre>
  
  <p>In the list above you notice that <code>ReportSchedule[0]</code> and <code>ReportSchedule[1]</code> both have the exact same reporting times listed of "09:23 Test1".  What I'm trying to do is get to a list that does not have these duplicate values, it only keeps one of the duplicate reporting time values.  Therefore, my ideal filtered list based on the above would be: (It doesn't matter that <code>Day</code> is not grouped/unique, just the <code>ReportTimes</code> based on the same 'Day')</p>
  
  <pre><code>    [0]-&gt;Day: 'Sunday'
               [ReportTimes]: [0]-&gt;hourOfDay: '09'
                              minuteOfDay: '23'
                              reportType: 'Test1'
                         [1]-&gt;hourOfDay: '08'
                              minuteOfDay: '11'
                              reportType: 'Test2'
          [1]-&gt;Day: 'Sunday'
               [ReportTimes]: [0]-&gt;hourOfDay: '11'
                              minuteOfDay: '30'
                              reportType: 'Test1'
          [2]-&gt;Day: 'Monday'
               [ReportTimes]: [0]-&gt;hourOfDay: '09'
                              minuteOfDay: '23'
                              reportType: 'Test1'
  </code></pre>