public void DoExercise(Person person, ExerciseType type, double hours) { if (person == null) { throw new ArgumentNullException("Person argument is null"); } if (_people.FirstOrDefault(p => p == person) == null) { Console.WriteLine("User not found."); return; } var result = new Result { Date = DateTime.Now, Type = type, Calories = _exerciseManager.Exercise(type, hours, person.Weight) }; person.CaloriesPerDay.Add(result); }