public ActionResult <string> GenerateDominion([FromBody] GenerateDominionRequest request)
        {
            var expansionsByName = Enum.GetValues(typeof(Dominion.Expansion))
                                   .Cast <Dominion.Expansion>()
                                   .ToDictionary(expansion => expansion.GetExpansionName());
            var selectedExpansions = request.SelectedExpansionNames
                                     .Select(expansionName => expansionsByName[expansionName])
                                     .ToList();
            var bytes = DominionLabels.CreateLabels(selectedExpansions);

            return(S3Service.UploadPdfToS3(bytes, "DominionLabels"));
        }
Esempio n. 2
0
        public FileResult GenerateDominion(IEnumerable <string> expansionNames)
        {
            var expansionsByName = Enum.GetValues(typeof(Avery16282Generator.Dominion.Expansion))
                                   .Cast <Avery16282Generator.Dominion.Expansion>()
                                   .ToDictionary(expansion => expansion.GetExpansionName());
            var includedSets = expansionNames
                               .Select(expansionName => expansionsByName[expansionName])
                               .ToList();
            var bytes = DominionLabels.CreateLabels(includedSets);

            return(File(bytes, "application/document", "DominionLabels.pdf"));
        }