title: Can the below function be improve?(C#3.0)
body: <p>I have the below function </p>
  
  <pre><code>public static List&lt;DateTime&gt; GetOnlyFridays(DateTime endDate, int weeks, bool isIncludeBaseDate)
  {
      //Get only the fridays from the date range
      List&lt;DateTime&gt; dtlist = new List&lt;DateTime&gt;();
  
      List&lt;DateTime&gt; tempDtlist = (from dtFridays in GetDates(endDate, weeks)
                                   where dtFridays.DayOfWeek == DayOfWeek.Friday
                                   select dtFridays).ToList();
  
      if (isIncludeBaseDate)
      {
          dtlist = tempDtlist.Skip(1).ToList();
          dtlist.Add(endDate);
      }
      else
      {
          dtlist = tempDtlist;
      }
  
      return dtlist;
  }
  </code></pre>
  
  <p>What basically I am doing is getting the datelist using the <strong>GetDates</strong> function and then depending on the <code>isIncludeBaseDate bool value</code>(if true) skipping the last date and adding the <code>Base Date</code></p>
  
  <p>It is working fine but can this program can be improve?</p>
  
  <p>I am using C#3.0 and Framework 3.5</p>
  
  <p>Thanks</p>