Example #1
0
 /// <summary>
 /// Returns the milestones assigned to
 /// the goal with the matching ID
 /// </summary>
 /// <param name="goalId">The ID of the Goal</param>
 /// <returns>The collection of milestones for the goal</returns>
 public IEnumerable <Milestone> GetMilestonesForGoal(int goalId)
 {
     return(ExecuteThenOrderBy(() => milestoneRepository.GetForGoal(goalId), milestone => milestone.Id));
 }
Example #2
0
        /// <summary>
        /// Returns the milestones that have been surpased for this goal
        /// given the amount that has been provided to the method
        /// </summary>
        /// <param name="goalId">The ID of the goal we are checking</param>
        /// <param name="currentGoalAmount">The amount of the goal at present</param>
        /// <returns>The milestones that have been surpassed</returns>
        private IEnumerable <Milestone> GetSurpassedMilestonesForGoal(int goalId, double currentGoalAmount)
        {
            IEnumerable <Milestone> goalMilestones = milestoneRepository.GetForGoal(goalId);

            return(goalMilestones.Where(ms => ms.Target <= currentGoalAmount));
        }