Ejemplo n.º 1
0
        public HttpResponseMessage <List <string> > ListImages()
        {
            var databaseImagesNames = new List <string>();
            var allImages           = satelliteImageRepository.GetImagesUrlPath();

            foreach (var i in allImages)
            {
                var urlParts = i.Split('/');
                var last     = urlParts.Last();
                databaseImagesNames.Add(last);
            }
            List <string> serverImagesNames = XmlParserSatelliteImages.ListImages();

            List <string> imagesToHide = serverImagesNames.Intersect(databaseImagesNames).ToList();
            List <string> imagesToShow = serverImagesNames.Except(imagesToHide).ToList();

            return(new HttpResponseMessage <List <string> >(imagesToShow)
            {
                StatusCode = HttpStatusCode.OK
            });
        }