title: Adding missing Enumerations into the list C#
body: <p>I have written a following code which basically groups my sales by days and then I show them to users on graph like following:</p>
  
  <pre><code>   var DailyGraph = userStores.ToList().GroupBy(x =&gt; x.TransactionDate.Value.DayOfWeek).Select(pr =&gt; new { Day = pr.Key.ToString(), Sales = pr.Sum(x =&gt; x.QuantitySoldTransaction) });
     var dayIndex = new List&lt;string&gt; { "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" };
     ViewBag.DailyGraph = DailyGraph.OrderBy(e =&gt; dayIndex.IndexOf(e.Day.ToUpper())).ToList();
  </code></pre>
  
  <p>Okay so what happens here, in first line I group all of the available sales by day of the week parameter which is Enumeration... Then I create a list of strings with exact day names like the Enumeration , I compare them so that I can order them in exact line as days go (from Monday to Sunday)...</p>
  
  <p>My problem here is now that if user didn't had sales in specific days... Let's say Monday and Thursday he didn't have sales... How could I now add these missing days to my list here ? I'm a little bit confused on how do to that since i'm working with enumeration...</p>
  
  <p>So the current output would be:</p>
  
  <pre><code>Tuesday    5 sales
  Wednesday  9 sales
  Friday     4 sales
  Saturday   13 sales
  Sunday     5 sales
  </code></pre>
  
  <p>And the desired output is:</p>
  
  <pre><code>Monday     0 sales // Add missing day enumeration and assign 0 value
  Tuesday    5 sales
  Wednesday  9 sales
  Thursday   0 sales // Add missing day enumeration and assign 0 value
  Friday     4 sales
  Saturday   13 sales
  Sunday     5 sales
  </code></pre>
  
  <p>Can someone help me out?</p>
  
  <p>Dan , something like this? </p>
  
  <pre><code>for (int i = 0; i &lt; DailyGraph.Count(); i++)
                      {
                          if (!dayIndex.Contains(DailyGraph[i].Day.ToUpper()))
                          {
                              DailyGraph.Add(new HourlyGraph { Day = dayIndex.ElementAt(i), Sales = 0 });
                          }
                      }
  </code></pre>