title: How can I use the return of .DayOfWeek to check property of class
body: <p>I have a scheduler program which allows the user to choose which days of the week it will be allowed to run a schedule.</p>
  
  <p>The properties in my class include each day of the week.</p>
  
  <p>Instead of using 7 statments like <code>if (Schedule[i].Sunday == true)</code></p>
  
  <p>How would I go about something like this:</p>
  
  <pre><code>if (Schedule[i].(DateTime.Now.DayOfWeek) == true)
  </code></pre>