public IEnumerable <SMSDto> GetSmsesForCustomer(int customerId) { lock (_obj) { IEnumerable <LineDto> linesForCustomer = _lineProvider.GetAllLines().Result.Where(l => l.CustomerId == customerId).ToList(); List <SMSDto> smses = new List <SMSDto>(); foreach (var line in linesForCustomer) { var smsesForLine = _smsProvider.GetAllSMSes().Result.Where(s => s.LineId == line.LineId).ToList(); smses.AddRange(smsesForLine); } return(smses); } }