Created
August 8, 2010 18:27
-
-
Save suryagaddipati/514378 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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