private void listCommand(CommandLineApplication command)
 {
     command.OnExecute(() =>
     {
         foreach (var map in _mapService.FindAllAsync().Result)
         {
             Console.WriteLine($"{map.Id} {map.Description}");
         }
         return(0);
     });
 }
        private async Task <ImageRecord[]> GetUnusedImagesAsync()
        {
            var images = await _imageService.FindAllAsync();

            var usedImageIdSources = new IEnumerable <Guid?>[] {
                (await _dealerService.FindAllAsync()).SelectMany(a => new Guid?[] { a.ArtistImageId, a.ArtistThumbnailImageId, a.ArtPreviewImageId }),
                (await _eventService.FindAllAsync()).SelectMany(a => new Guid?[] { a.BannerImageId, a.PosterImageId }),
                (await _announcementService.FindAllAsync()).Select(a => a.ImageId),
                (await _knowledgeEntryService.FindAllAsync()).SelectMany(a => a.ImageIds.Select(b => b as Guid?)),
                (await _mapService.FindAllAsync()).Select(a => a.ImageId as Guid?)
            };

            var usedImageIds = usedImageIdSources
                               .SelectMany(a => a)
                               .Where(a => a.HasValue)
                               .Select(a => a.Value)
                               .ToArray();

            return(images.Where(a => !usedImageIds.Contains(a.Id)).ToArray());
        }
Ejemplo n.º 3
0
 public Task <IEnumerable <MapRecord> > GetMapsAsync()
 {
     return(_mapService.FindAllAsync());
 }