title: Efficient way to split enum flags to create distinct items in collection
body: <p>I have a collection like this:</p>
  
  <pre><code>IEnumerable&lt;RecordToSend&gt; recordsToSend;
  </code></pre>
  
  <p>Made up of the following:</p>
  
  <pre><code>public class RecordToSend {
      public Guid ApplicationId { get; set; }
      public ScheduleTypes Schedule { get; set; }
  }
  </code></pre>
  
  <p>And flag enum:</p>
  
  <pre><code>[Flags]
  public enum ScheduleTypes
  {
      None = 0,
      Daily = 1,
      Weekly = 2,
      Monthly = 4
  }
  </code></pre>
  
  <hr>
  
  <p>So let's say I have the following collection, which is basically pulled out of the database using an Entity Framework query:</p>
  
  <pre><code>| ApplicationId | Schedule |
  | ABC123        | 7        |
  | DEF456        | 3        |
  </code></pre>
  
  <p>What would be an effective way to split on the enum into multiple distinct records, resulting in this (could use the <code>RecordToSend</code> class, or another type, even a dynamic if it makes sense):</p>
  
  <pre><code>| ApplicationId | Schedule |
  | ABC123        | 1        |
  | ABC123        | 2        |
  | ABC123        | 4        |
  | DEF456        | 1        |
  | DEF456        | 2        |
  </code></pre>
  
  <hr>
  
  <p>Note the <code>ScheduleTypes</code> enum has a 0 value flag, which I'd like to ignore in the result.</p>
  
  <p>Efficiency is not of utmost concern, though I'm curious to hear thoughts on performance of different approaches. If it's possible to perform this split in a single step as part of the Entity Framework query as I'm pulling the collection out of the database, that would be great. Within the application I don't have any need for the enum flags in their original, multi-value state.</p>