Exemple #1
0
        private async Task <IEnumerable <Service> > GetServicesAsync(ApplicationList applicationList, GetInstancesResponse usage)
        {
            var app = applicationList.SingleOrDefault(a =>
            {
                var appName = $"{a.ApplicationName.AbsoluteUri}/";
                return(usage.ServiceTypeUri.StartsWith(appName));
            });

            if (app == null)
            {
                return(new List <Service>());
            }

            return((await _fabricClient.QueryManager.GetServiceListAsync(app.ApplicationName))
                   .Where(g => g.ServiceName.AbsoluteUri.Contains(usage.ServiceTypeUri))
                   .ToList());
        }