private static Performance ExtractPerformance(PerformanceDto performance) { return(new Performance { Depth = performance.Depth, Distance = performance.Distance, Duration = performance.Duration, Points = performance.Points, }); }
public double GetPoints(string rulesName, PerformanceDto performance) { if (string.IsNullOrEmpty(rulesName)) { throw new ArgumentNullException("Missing RulesName"); } if (performance == null) { throw new ArgumentNullException("Missing Performance"); } var rules = rulesRepository.Get(rulesName); if (rules == RulesUnknown.Default) { throw new ArgumentOutOfRangeException("Unknown RulesName " + rulesName); } return(rules.GetPoints(ExtractPerformance(performance))); }