public async Task <IList <ServiceSummaryModel> > GetAllSummary(string ownerPublicKey) { var services = await GetAll(ownerPublicKey); var result = new List <ServiceSummaryModel>(); foreach (var s in services) { var summary = new ServiceSummaryModel(s); summary.ActiveRoleCount = await _roleManager.CountByService(s.OwnerKeyId, s.Id, false); summary.DisabledRoleCount = await _roleManager.CountByService(s.OwnerKeyId, s.Id, true); summary.ApiCount = await _apiManager.Count(s.OwnerKeyId, s.Id); result.Add(summary); } return(result); }