public double CalculateTotalMinutesOfTopNumber(int lineId) { lock (obj) { string destinationNumber = callManager.GetCallsDtos(lineId).Max(l => l.DestinationNumber); if (lineManager.GetLineByNumber(destinationNumber) != null) { double totalMinutesOfTopNumber = callManager.GetCallsDtos(lineId).Where(l => l.DestinationNumber == destinationNumber).Sum(l => l.Duration); return(totalMinutesOfTopNumber); } return(0); } }