AzureLens.Areas.HelpPage.HelpPageConfigurationExtensions.GenerateSamples C# (CSharp) 메소드

GenerateSamples() 개인적인 메소드

private GenerateSamples ( HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator ) : void
apiModel AzureLens.Areas.HelpPage.Models.HelpPageApiModel
sampleGenerator HelpPageSampleGenerator
리턴 void
        private static void GenerateSamples(HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator)
        {
            try
            {
                foreach (var item in sampleGenerator.GetSampleRequests(apiModel.ApiDescription))
                {
                    apiModel.SampleRequests.Add(item.Key, item.Value);
                    LogInvalidSampleAsError(apiModel, item.Value);
                }

                foreach (var item in sampleGenerator.GetSampleResponses(apiModel.ApiDescription))
                {
                    apiModel.SampleResponses.Add(item.Key, item.Value);
                    LogInvalidSampleAsError(apiModel, item.Value);
                }
            }
            catch (Exception e)
            {
                apiModel.ErrorMessages.Add(String.Format(CultureInfo.CurrentCulture,
                    "An exception has occurred while generating the sample. Exception message: {0}",
                    HelpPageSampleGenerator.UnwrapException(e).Message));
            }
        }