コード例 #1
0
        public ActionResult <string> GenerateLegendary([FromBody] GenerateLegendaryRequest request)
        {
            var expansionsByName = Enum.GetValues(typeof(Legendary.Enums.Expansion))
                                   .Cast <Legendary.Enums.Expansion>()
                                   .ToDictionary(expansion => expansion.GetExpansionName());
            var selectedExpansions = request.SelectedExpansionNames
                                     .Select(expansionName => expansionsByName[expansionName])
                                     .ToList();
            var bytes = LegendaryLabels.CreateLabels(selectedExpansions, request.IncludeSpecialSetupCards);

            return(S3Service.UploadPdfToS3(bytes, "LegendaryLabels"));
        }
コード例 #2
0
        public FileResult GenerateLegendary(IEnumerable <string> expansionNames, bool includeSpecialSetupCards)
        {
            var expansionsByName = Enum.GetValues(typeof(Avery16282Generator.Legendary.Enums.Expansion))
                                   .Cast <Avery16282Generator.Legendary.Enums.Expansion>()
                                   .ToDictionary(expansion => expansion.GetExpansionName());
            var includedSets = expansionNames
                               .Select(expansionName => expansionsByName[expansionName])
                               .ToList();
            var bytes = LegendaryLabels.CreateLabels(includedSets, includeSpecialSetupCards);

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