csharp Program.cs中

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp Program.cs中相关的知识,希望对你有一定的参考价值。

using System;
using System.Collections.Generic;
using System.Linq;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace SwaggerClientTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //Create a new instance
            var clientConfig = new Configuration();
            //Add the key to the Authorization header
            clientConfig.ApiKey["api_key"] = "special-key";

            //Pass the config through the api ctor
            var petapi = new PetApi(clientConfig);

            //Pet statuses
            var statuses = new List<string> {"available"};
            //Get top 10 pets with status: available
            List<Pet> pets = petapi.FindPetsByStatus(statuses).Take(10).ToList();

            foreach (var pet in pets)
            {
                Console.WriteLine(pet.Name);
            }
            Console.ReadKey();
        }
    }
}

以上是关于csharp Program.cs中的主要内容,如果未能解决你的问题,请参考以下文章

csharp Program.cs中

csharp Program.cs中

csharp Program.cs中

csharp Async C#program.cs

csharp JiraClientTest.Program.cs

csharp 在Program.cs中设置appsettings