title: Store DayOfWeek data in SQL Server
body: <p>I want to save the <code>DayOfWeek</code> data as a column in a SQL Server table. Is this possible? ATM I'm saving an int and converting to DayOfWeek with a switch method, but I wish I could save and retrieve the data directly from the database.</p>
  
  <p>UPDATE
  I will try to explain. The user creates a recurring event, usually 2 times a week, for example, Monday and Friday. I want to create (on code run) all the recurring events in a given month, SO I want to store the DayOfWeek in SQL because for every event user can register if another user were present, late or so on..
  Here a part of the code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public static List&lt;int&gt; GetAttendance(int year, int month, DayOfWeek doW_1, DayOfWeek doW_2)
          {
              var days = DateTime.DaysInMonth(year, month);
              var attendances = new List&lt;int&gt;();
  
              for (int currentDay = 1; currentDay &lt;= days; currentDay++)
              {
                  var day = new DateTime(year, month, currentDay);
                  if (day.DayOfWeek == doW_1 || day.DayOfWeek == doW_2)
                  {
                      attendances.Add(currentDay);
                  }
              }
  
              return attendances;
          }
  </code></pre>
  
  <p>doW1 and 2 comes from a little converter method made by me who read in db the integer stored by the user to create the recurring events.</p>
  
  <p>UPDATE 2: I want to store data this way because I will use them for PREDICT future events by user inputs. Clear now?</p>