Skip to content

Instantly share code, notes, and snippets.

@suryagaddipati
Created August 8, 2010 18:27
Show Gist options
  • Save suryagaddipati/514378 to your computer and use it in GitHub Desktop.
Save suryagaddipati/514378 to your computer and use it in GitHub Desktop.
public static WeeklyActivityRecorder WithActivities(this WeeklyActivityRecorder recorder, params Expression<Func<DayOfWeek, string>>[] activities)
{
foreach( var activity in activities )
{
LambdaExpression expression = activity;
ConstantExpression activity= expression.Body as ConstantExpression;
DayOfWeek day = expression.Parameters[0];
recorder.AddActivity(new Activity {DayOfWeek = day , Activity = activity});
}
return recorder ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment