public void CalculateCost()
    {
        this.cost = 0;
        Dictionary<string, List<Course>> conferenceCourseCount = new Dictionary<string, List<Course>>();
        foreach (RegistrationLine regLine in registeringLine)
        {
            if (conferenceCourseCount.ContainsKey(regLine.LineCourse.CourseConference))
            {
                conferenceCourseCount[regLine.LineCourse.CourseConference].Add(regLine.LineCourse);
            }
            else
            {
                conferenceCourseCount.Add(regLine.LineCourse.CourseConference, new List<Course>{regLine.LineCourse});
            }
        }

        foreach(string regCon in conferenceCourseCount.Keys)
        {
            Conference newConference = new Conference(regCon);
            if (conferenceCourseCount[regCon].Count == newConference.CoursesInConference.Count)
            {
                this.cost += newConference.WholeConferenceCost;
                conferenceCourseCount[regCon].Select(course => course.Cost = 0).ToList();
            }
            else
            {
                if (newConference.GetPreviousRegCoursesInConference(registeringUser.Email)[0] + conferenceCourseCount[regCon].Count
                    == newConference.CoursesInConference.Count)
                {
                    this.cost += newConference.WholeConferenceCost -
                                 newConference.GetPreviousRegCoursesInConference(registeringUser.Email)[1];
                    conferenceCourseCount[regCon].Select(course => course.Cost = 0).ToList();
                }
                else
                {
                    this.cost += conferenceCourseCount[regCon].Sum(x => x.Cost);
                }
            }
        }
    }